Linux Command ls
What?
List contents of a directory
How?
Ls [-ABCFGHLOPRSTUW @ abcdefghiklmnopqrstuwx1] [file...]
Points -- Common Parameters
Ls-l displays detailed information about the directory file [linux File Attributes]
Ls-t sort by modification time in reverse order
Ls-r reverse in reverse order
Ls-F identifies the type of the file/indicates the directory * indicates the executable file @ indicates soft connection = indicates the socket file | indicates that these identifiers of the MPs queue file follow the file name
Example
Displays the file details in the directory in reverse order of the modification time (the latest modification is at the bottom)
Using test ls-lrtF
Total 8
Drwxr-xr-x 2 a2014 staff 68 1 20 18:07 movies/
Drwxr-xr-x 2 a2014 staff 68 1 20 18:07 music/
Drwxr-xr-x 2 a2014 staff 68 1 20 18:07 download/
Drwxr-xr-x 2 a2014 staff 68 1 20 18:08 documents/
Drwxr-xr-x 2 a2014 staff 68 1 20 18:08 pictures/
-Rw-r -- 1 a2014 staff 2 1 20 18:27 test.txt
-Rw-r -- 1 a2014 staff 0 1 20 18:28 test1.txt
Total -- size of files and directories in this directory, in KB
For other details, see the detailed attributes of the Linux File below.
Total 0
Drwxr-xr-x 2 a2014 staff 68 1 20 documents
Drwxr-xr-x 2 a2014 staff 68 1 20 18:07 download
Drwxr-xr-x 2 a2014 staff 68 1 20 18:07 movies
Drwxr-xr-x 2 a2014 staff 68 1 20 18:07 music
Drwxr-xr-x 2 a2014 staff 68 1 20 18:08 pictures
-Rw-r -- 1 a2014 staff 0 1 20 18:08 test.txt
Total -- size of files and directories in this directory, in KB
The first field has a total of 10 characters. The first character represents the type of the file, and d represents the path, and-represents the normal file. The remaining 9 characters are represented in three groups.
Implementation of ls commands in Linux
This article permanently updates the link address: