ls(list)
ls(list)功能说明:列出目录内容。
语 法:ls [-1aAbBcCdDfFgGhHiklLmnNopqQrRsStuUvxX][-I <范本样式>][-T <跳格字数>][-w <每列字符数>][--block-size=<区块大小>][--color=<使用时机>][--format=<列表格式>][--full-time][--help][--indicator-style=<标注样式>][--quoting-style=<引号样式>][--show-control-chars][--sort=<排序方式>][--time=<时间戳记>][--version][文件或目录...]
补充说明:执行ls指令可列出目录的内容,包括文件和子目录的名称。
参 数:
-1 每列仅显示一个文件或目录名称。
-a或--all 下所有文件和目录。
-A或--almost-all 显示所有文件和目录,但不显示现行目录和上层目录。
-b或--escape 显示脱离字符。
-B或--ignore-backups 忽略备份文件和目录。
-c 以更改时间排序,显示文件和目录。
-C 以又上至下,从左到右的直行方式显示文件和目录名称。
-d或--directory 显示目录名称而非其内容。
-D或--dired 用Emacs的模式产生文件和目录列表。
-f 此参数的效果和同时指定"aU"参数相同,并关闭"lst"参数的效果。
-F或--classify 在执行文件,目录,Socket,符号连接,管道名称后面,各自加上"*","/","=","@","|"号。
-g 次参数将忽略不予处理。
-G或--no-group 不显示群组名称。
-h或--human-readable 用"K","M","G"来显示文件和目录的大小。
-H或--si 此参数的效果和指定"-h"参数类似,但计算单位是1000Bytes而非1024Bytes。
-i或--inode 显示文件和目录的inode编号。
-I<范本样式>或--ignore=<范本样式> 不显示符合范本样式的文件或目录名称。
-k或--kilobytes 此参数的效果和指定"block-size=1024"参数相同。
-l 使用详细格式列表。
-L或--dereference 如遇到性质为符号连接的文件或目录,直接列出该连接所指向的原始文件或目录。
-m 用","号区隔每个文件和目录的名称。
-n或--numeric-uid-gid 以用户识别码和群组识别码替代其名称。
-N或--literal 直接列出文件和目录名称,包括控制字符。
-o 此参数的效果和指定"-l" 参数类似,但不列出群组名称或识别码。
-p或--file-type 此参数的效果和指定"-F"参数类似,但不会在执行文件名称后面加上"*"号。
-q或--hide-control-chars 用"?"号取代控制字符,列出文件和目录名称。
-Q或--quote-name 把文件和目录名称以""号标示起来。
-r或--reverse 反向排序。
-R或--recursive 递归处理,将指定目录下的所有文件及子目录一并处理。
-s或--size 显示文件和目录的大小,以区块为单位。
-S 用文件和目录的大小排序。
-t 用文件和目录的更改时间排序。
-T<跳格字符>或--tabsize=<跳格字数> 设置跳格字符所对应的空白字符数。
-u 以最后存取时间排序,显示文件和目录。
-U 列出文件和目录名称时不予排序。
-v 文件和目录的名称列表以版本进行排序。
-w<每列字符数>或--width=<每列字符数> 设置每列的最大字符数。
-x 以从左到右,由上至下的横列方式显示文件和目录名称。
-X 以文件和目录的最后一个扩展名排序。
--block-size=<区块大小> 指定存放文件的区块大小。
--color=<列表格式> 培植文件和目录的列表格式。
--full-time 列出完整的日期与时间。
--help 在线帮助。
--indicator-style=<标注样式> 在文件和目录等名称后面加上标注,易于辨识该名称所属的类型。
--quoting-syte=<引号样式> 把文件和目录名称以指定的引号样式标示起来。
--show-control-chars 在文件和目录列表时,使用控制字符。
--sort=<排序方式> 配置文件和目录列表的排序方式。
--time=<时间戳记> 用指定的时间戳记取代更改时间。
--version 显示版本信息。
ls
ls [options] [names]
List contents of directories. If no names are given, list the files in the current directory. With one or more names, list files contained in a directory name or that match a file name. names can include filename metacharacters. The options let you display a variety of information in different formats. The most useful options include -F, -R, -l, and -s. Some options don't make sense together (e.g., -u and -c).
Options
Print one entry per line of output.
List all files, including the normally hidden files whose names begin with a period.
Display nonprinting characters in octal and alphabetic format.
List files by status change time (not creation/modification time).
Colorize the names of files depending on the type of file. Accepted values for when are never, always, or auto.
Report only on the directory, not its contents.
Print directory contents in exactly the order in which they are stored, without attempting to sort them.
List times in full, rather than using the standard abbreviations.
Long listing like -l, but don't show file owners.
Print sizes in kilobytes and megabytes.
Print a help message and then exit.
List the inode for each file.
Display filenames without the flags assigned by -p or -f (default).
If file sizes are being listed, print them in kilobytes. This option overrides the environment variable POSIXLY_CORRECT.
Long format listing (includes permissions, owner, size, modification time, etc.).
Merge the list into a comma-separated series of names.
Like -l, but use group ID and user ID numbers instead of owner and group names.
Long listing like -l, but don't show group information.
Mark directories by appending / to them.
Show nonprinting characters as ? (default for display to a terminal).
List files in reverse order (by name or by time).
Print file size in blocks.
Show nonprinting characters verbatim (default for printing to a file).
Similar to -h, but uses powers of 1,000 instead of 1,024.
Sort files according to modification time (newest first).
Sort files according to file-access time.
Print version information on standard output, then exit.
List files in rows going across the screen.
Interpret the digits in names such as file.6 and file.6.1 as versions, and order filenames by version.
Format output to fit n columns.
List all files, including the normally hidden files whose names begin with a period. Does not include the . and .. directories.
Do not list files ending in ~ unless given as arguments.
List files in columns (the default format).
List in a format suitable for Emacs dired mode.
Flag filenames by appending / to directories, * to executable files, @ to symbolic links, | to FIFOs, and = to sockets.
In long format, do not display group name.
When symbolic links are given on the command line, follow the link and list information from the actual file.
Do not list files whose names match the shell pattern pattern, unless they are given on the command line.
List the file or directory referenced by a symbolic link rather than the link itself.
Display special graphic characters that appear in filenames.
Quote filenames with "; quote nongraphic characters.
List directories and their contents recursively.
Load state from file before starting execution.
Sort by file size, largest to smallest.
Do not sort files.
Sort by file extension, then by filename.