7.5 "Linux learning is not difficult" file/directory Management (5): LS command lists directory and file information
With the LS command, all subdirectories and file information will be listed for the directory, and the file name and other information requested will be exported.
Command syntax:
ls [options] [directory | file]
The meanings of the options in the command are as shown in the table.
Options |
option meaning |
-A |
displays all subdirectories and files in the specified directory, including hidden files |
-C |
mate -lt: Sort by CTime and show CTime |
-D |
If the parameter is a directory, only its name is displayed and the files and subdirectories below it are not displayed |
-F |
Show file Types |
-I. |
Displays the Inode number of the file in the first column of the output |
-L |
to display the details of a file in a long format |
-R |
reverse Order |
-T |
Sort by modified time |
-S |
Sort by file size |
Example: Displays simple information about files and subdirectories in the directory/var.
[Email protected] ~]# Ls/var
Example: Displays details of all files and subdirectories in the/root directory, including hidden files.
[Email protected] ~]# Ls-al/root
Example: Sort the files and subdirectories in the/root directory with the last access time (last time) of the file.
[Email protected] ~]# Ls-ltr/root
This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .
"Linux learning is not difficult" file/directory Management (5): LS command lists directory and file information