LsList segment is a frequently used command in Linux.
Command Format:Ls args dir
Args: Parameter;
Dir: Directory. If it is omitted, it indicates the current directory;
Common Parameters and descriptions are as follows::
-A [common] lists all files in a directory, including hidden files starting.
-C: the time when the I node of the output file is modified and sorted accordingly.
-I: index information of the I node of the output file.
-K indicates the file size in the form of k bytes.
-L [common] lists detailed information about objects.
-M horizontal output file name, with "," as a grid character.
-N is replaced by the UID and GID of the number.
-O displays the details of the file except the group information.
-F attaches a character to each file name to indicate the file type: "*": executable normal file; "/": Directory; "@": Symbolic Link; "|": FIFOs; "=": socket (sockets ).
-Q used? Replace non-printable characters.
-R sorts directories in reverse order.
-S outputs the file size after each file name.
-T is sorted by time and recently modified to the top.
-U is sorted by the time when the file was last accessed.
-X is output by column and sorted horizontally.
-R recursion outputs the content of all subdirectories.
-S [commonly used] is sorted by file size, where large files are located.
-X is sorted by file extension (the character after the last ).
-1 (number 1): one row outputs only one file.
-- Color: display the color file name (equivalent to -- color = auto ).
-- Color = no: Do not display color file names
-- Time-style custom display time format (commonly used '+ % Y/% m/% d % H: % M: % s' format)
-- Help displays help information on the standard output.
-- Version outputs the version information on the standard output and exits.
TIPS:
Edit the/etc/bashrc file and add the code: alias ls = "ls -- color"
Make the color display always exist. The color meaning is as follows:
Blue [Directory]; green [executable files]; red [compressed files]; light blue [linked files]; gray [other files];
Custom display time format
$> Ls-l -- time-style '+ % Y/% m/% d % H: % M: % s'
Total 0
-Rw-r -- 1 root 0 2008/08/01 12:23:06 file1
-Rw-r -- 1 root 0 2008/08/01 12:23:06 file2
The system that supports -- time-style can be set with the environment variable TIME_STYLE;
$> Export TIME_STYLE = '+ % Y/% m/% d % H: % M: % s'
To take effect permanently, append the above sentence to/etc/profile.