本 Wiki 开启了 HTTPS。但由于同 IP 的 Blog 也开启了 HTTPS,因此本站必须要支持 SNI 的浏览器才能浏览。为了兼容一部分浏览器,本站保留了 HTTP 作为兼容。如果您的浏览器支持 SNI,请尽量通过 HTTPS 访问本站,谢谢!
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
linux:bash [2023/12/13 14:18] – [ls] codinghare | linux:bash [2024/01/14 13:57] (当前版本) – [Bash & Shell] codinghare | ||
---|---|---|---|
行 1: | 行 1: | ||
======Bash & Shell====== | ======Bash & Shell====== | ||
- | 常用的 bash 命令 | + | //常用的 bash 命令// |
---- | ---- | ||
- | ====命令==== | + | |
====Navigation==== | ====Navigation==== | ||
<code bash> | <code bash> | ||
+ | ##ls | ||
# 查看当前目录下所有的文件夹和文件 | # 查看当前目录下所有的文件夹和文件 | ||
ls | ls | ||
+ | # 查看所有文件夹和文件,包括隐藏 | ||
+ | ls -a | ||
+ | # 查看详细信息 | ||
+ | ls -l | ||
+ | # 查看文件,按上次修改时间排列 | ||
+ | ls -t | ||
+ | ##pwd | ||
+ | # 打印当前目录的路径 | ||
+ | pwd | ||
+ | ##cd | ||
+ | # 切换到指定文件夹 | ||
+ | cd <folder name> | ||
+ | cd < | ||
+ | # 返回上级目录 | ||
+ | cd .. | ||
+ | ##mkdir | ||
+ | # | ||
+ | mkdir <folder name> | ||
+ | |||
+ | ##touch | ||
+ | # | ||
+ | touch <file name> | ||
</ | </ | ||
+ | === ls -l 的详细信息解释=== | ||
+ | '' | ||
+ | <code bash> | ||
drwxr-xr-x 5 cc eng 4096 Jun 24 16:51 action | drwxr-xr-x 5 cc eng 4096 Jun 24 16:51 action | ||
- | Access rights. These indicate the read, write, and execute permissions on the file or directory allowed to the owner, | + | </ |
- | Number of hard links. This number counts the number of child directories and files. This number includes the parent directory link (..) and current directory link (.). | + | 具体的解释见下图: |
- | The username of the file’s | + | {{ : |
- | The name of the group that owns the file. Here the group name is eng. | + | ==access right== |
- | The size of the file in bytes. | + | 背景知识:Linux 中: |
- | The date & time that the file was last modified. | + | * premission group 分为三类:// |
- | The name of the file or directory | + | * premission type 也分为三类:// |
- | + | //access right// 是详细信息中的 10 位字母,结构如下: | |
- | + | * 头一位字母是 special permission flag | |
- | + | * 2-4 位代表了 | |
+ | * 5-7 代表了 | ||
+ | * 8-10 代表了 all user 的权限 | ||
+ | 权限中,read 权限标记为 '' | ||
+ | ====Viewing and Changing File System==== | ||
+ | ===Manipulation=== | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
* '' | * '' | ||
* '' | * '' |