Enter ls --help at the prompt, and the screen will display the format and parameter information of the command:
First introduce the main parameters of the ls command:
-a List all files in the directory, including implicit files starting with .
-A show all files except "." and ".."
-b List unprintable characters in filenames as a backslash followed by a character number .
-B Do not output backup files ending with "~".
-c Print the modification times of the file's inodes, sorted by this.
-C Output by column, sorted vertically.
-d Display the directory as a file instead of the files under it.
-e The ls command option can output full information about the time, rather than outputting abbreviated information.
-f -U The ls command option can unsort the output files.
-i The ls command option can output the index information of the inode of the file.
-k The ls command option can express the size of the file in k bytes.
-l The ls command option can list file details.
-m The ls command option can output file names horizontally, with "," as the space character.
-n The ls command option can use numeric GUIDs instead of names.
-o The ls command option can display detailed information about a file in addition to group information.
-p -F The ls command option can append a character to each file name to indicate the type of the file, "*" indicates an executable ordinary file; "/" indicates a directory; "@" indicates a symbolic link; " |" means FIFOs; "=" means sockets.
-q The ls command option can use ? instead of non-printable characters.
-r The ls command option can reverse the sorting of directories.
-s The ls command option can output the size of the file after each file name.
-t The ls command option can be sorted by time.
-u The ls command option can be sorted by the time the files were last accessed.
-x The ls command option can output by column, sorted horizontally.
-G The ls command option can output the group information of the file.
-L The ls command option can list linked file names instead of linked files.
-N The ls command option will not limit the file length.
-Q The ls command option can enclose the output file name in double quotes.
-R The ls command option can list files in all subdirectories.
-S The ls command option can be sorted by file size.
-X 该ls命令选项可以以文件的扩展名(最后一个 . 后的字符)排序。
-1 该ls命令选项可以一行只输出一个文件。
===================================
常用的
#ls -lt 按修改时间排序,正序显示
#ls -ltr 按修改时间排序,反序显示
#ls -R 显示目录及多级子目录下的文件及目录信息
# ls -lh h参数与l参数结合,更合理的显示文件的大小
# ls - lS 已文件大小排序
# ls - R 递归显示文件夹
# ls -al |more 当文件夹下的文件及目录过多,一屏显示不下的情况下可以结合管道符及more命令使用,以实现分屏显示
文件颜色意义:
绿色---->代表可执行文件
红色---->代表压缩文件
深蓝色---->代表目录
浅蓝色----->代表链接文件
灰色---->代表其它的一些文件