ls命令
【用法】 ls (选项) (参数)
【介绍】 列出有关FILE的信息(默认为当前目录), 如果没有指定 -cftuvSUX 或 --sort,则按字母顺序对条目进行排序
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
| 选项 | 含义 |
|---|---|
| -a | 显示所有文件, 包括以 "."开头的隐藏文件 |
| --all | 显示所有文件, 包括以 "."开头的隐藏文件 |
| -A | 显示除影藏文件"."和".."以外的所有文件 |
| --almost-all | 显示除影藏文件"."和".."以外的所有文件 |
| -b | 将文件中的不可输出的字符以反斜线"/"加字符编码的方式输出 |
| --escape | 将文件中的不可输出的字符以反斜线"/"加字符编码的方式输出 |
| -B | 不要列出以 ~ 结尾的隐含文件 |
| --ignore-backups | 不要列出以 ~ 结尾的隐含文件 |
| -c | 与"-lt"选项连用时, 按照文件状态时间排序输出目录内容,排序的依据是文件的索引节点中的ctime字段。与"-l"选项连用时,则排序的一句是文件的状态改变时间 |
| -C | 多列显示输出结果。这是默认选项 |
| --color[=WHEN] | 使用不同的颜色高亮显示不同类型的文件, 可选值包括"never"、"always"和"auto" |
| -d | 仅显示目录名,而不显示目录下的内容列表。显示符号链接文件本身,而不显示其所指向的目录列表 |
| --directory | 仅显示目录名,而不显示目录下的内容列表。显示符号链接文件本身,而不显示其所指向的目录列表 |
| -D | 生成专为Emacs的dired模式设计的输出 |
| --dired | 生成专为Emacs的dired模式设计的输出 |
| -f | 不排序,启用 -aU,禁用 -ls --color |
| -F | 在每个输出项后追加文件的类型标识符, 具体含义: "*"表示具有可执行权限的普通文件, "/"表示目录, "@"表示符号链接, "|"表示命令管道FIFO, "="表示sockets套接字. 当文件为普通文件时, 不输出任何标识符 |
| --classify | 在每个输出项后追加文件的类型标识符, 具体含义: "*"表示具有可执行权限的普通文件, "/"表示目录, "@"表示符号链接, "|"表示命令管道FIFO, "="表示sockets套接字. 当文件为普通文件时, 不输出任何标识符 |
| -g | 类似于 -l, 但不要列出所有者 |
| -G | 不列出任何有关组的信息 |
| --no-group | 不列出任何有关组的信息 |
| -h | 用 -l 和 / 或 -s, 以容易理解的格式列出文件大小(例如 1K 234M 2G) |
| --human-readable | 用 -l 和 / 或 -s, 以容易理解的格式列出文件大小(例如 1K 234M 2G) |
| -H | 使用命令列中的符号链接指示的真正目的地 |
| --dereference-command-line | 使用命令列中的符号链接指示的真正目的地 |
| options | meanings |
|---|---|
| -a | do not ignore entries starting with . |
| --all | do not ignore entries starting with . |
| -A | do not list implied . and .. |
| --almost-all | do not list implied . and .. |
| -b | print C-style escapes for nongraphic characters |
| --escape | print C-style escapes for nongraphic characters |
| -B | do not list implied entries ending with ~ |
| --ignore-backups | do not list implied entries ending with ~ |
| -c | with -lt: sort by, and show, ctime (time of last modification of file status information); with -l: show ctime and sort by name; otherwise: sort by ctime, newest first |
| -C | list entries by columns |
| --color[=WHEN] | colorize the output; WHEN can be 'always' (default if omitted), 'auto', or 'never'; more info below |
| -d | list directories themselves, not their contents |
| --directory | list directories themselves, not their contents |
| -D | generate output designed for Emacs' dired mode |
| --dired | generate output designed for Emacs' dired mode |
| -f | do not sort, enable -aU, disable -ls --color |
| -F | append indicator (one of */=>@|) to entries |
| --classify | append indicator (one of */=>@|) to entries |
| -g | like -l, but do not list owner |
| -G | in a long listing, don't print group names |
| --no-group | in a long listing, don't print group names |
| -h | with -l and/or -s, print human readable sizes(e.g., 1K 234M 2G) |
| --human-readable | with -l and/or -s, print human readable sizes(e.g., 1K 234M 2G) |
| -H | follow symbolic links listed on the command line |
| --dereference-command-line | follow symbolic links listed on the command line |
