The command ls -a option to list all the files in the directory, including Implied beginning of the document.
This form -b option to the ls command characters in the file name can not be output (just as in C language) with the backslash character numbered lists.
The ls command -c option to output file modification time i node , and this sort.
The ls -d command option to display the same directory as the file, rather than the files in the display.
The ls command -e option to output all the information on the time , rather than simple output information.
-f -U option of the ls command output is not sorted file .
-g useless.
The command ls -i option to output the index information i node file.
-k The ls command options can be in the form of k bytes represents the size of the file.
The command ls -l option to list the details of the file .
The -m option lateral ls command output file name, and "," as a sub-grid operator.
The ls command -n option instead of names with numbers GUID.
The ls command -o option in addition to detailed information outside the group information files can be displayed.
-p -F option of the ls command can attach to each file name characters to describe a type of the file, "*" indicates a regular file executable; "/" indicates a directory; "@" symbolic link; " | "represents FIFOs;" = "represents sockets (sockets).
The ls command -q option can be used? character instead of non-exportable.
The ls command -r option to reverse the order of the directory.
The ls command -s option to output size of the file after each file name.
The ls command -t option can be ordered in time .
-u option to the ls command file time is sort of the last visit .
The ls command -x option may be output by columns, lateral sorting.
The ls command -A option to display all files except "." And ".." outside.
-B This option does not output to the ls command "~" at the end of the backup file.
This option -C ls command output by columns, longitudinal sort.
The command ls -G option to output the file's group .
The ls command -L option to list links to the file name instead of linking to the file.
The ls command -N option will not restrict the length of documents.
-Q The ls command option to output the file name in double quotes.
The command ls -R option to list files in all subdirectories.
The ls command -S optionTo sort the file size .
-X option to sort the ls command with the file extension (characters after the last one.).
The ls -1 command line option can only output one file.
-Color = no option to the ls command can not display color file name
-help option to the ls command to display help information on the standard output.
The ls command option -version output version information on standard output and exit.
ls command lists only subdirectories
1. ls -F | grep / $ = Sub or Alias "ls -F | grep / $" (Linux)
2. ls -l | grep "^ D" or ls -lL | grep " d ^ "(the Solaris)
LS command to calculate the number of files and directories in the current directory
the following command can be calculated, respectively, the number of files and directories in the current directory:
# LS * the -l | grep" ^ - "| the -l WC - COUNT Files to
# LS * the -l | grep "^ d" | WC the -l - COUNT dir to
display a directory listing of color
open / etc / bashrc, add the following line:
Alias LS = "LS -color"
next time you start when bash It can be displayed as a color image in a directory listing Slackware, the meaning of which colors are as follows:
-
1. Blue - <directory
-
2. Green - <executable file
-
3. red - <archive
-
4. Light Blue - <link file
-
5. Gray - <Other documents