The LS command for Linux

Source: Internet
Author: User
Tags sorts

The LS command is one of the most commonly used commands under Linux. It is the abbreviation of the list, the lack of saving LS is used to print out the current directory of the list, if LS specifies a different directory, then the specified directory of files and folders will be displayed list.
We can use it to view various information about a file, including permissions, size, and so on.

Description of use of LS command: (there are some differences in different environments)
ls command format: ls "option" "Directory Name/file name"
ls Command function: Lists all subdirectories and files in the target directory.
Description of the parameter options for the LS command:
-a lists all subdirectories and files in the destination directory.
-B lists the characters that are not output in the file name in the form of a backslash and character number (as in the C language).
-C The modified time of the I node of the output file and sorted once.
-D Displays the directory as if it were a file, rather than displaying the file below it.
-e outputs the full information of the time, not the output of the abbreviated information. (ubuntu12.04 not supported)
-f-u the output file is not sorted.
-G is the same as-l but does not show the owner.
-I lists the I node index information for all files and directories.
-K represents the size of a file in the form of a byte.
-l lists the file and directory details.
-M landscape output file name, and one "," as the separator.
-N replaces the name with the uid,gid of the number.
-O Displays detailed information about the file in addition to the group information.
-p-f a character after each file name to indicate the type of file, "*" means the normal executable, "/" for the Directory, "@" for the symbolic link,
| Represents a pipe file, and "=" represents a socket file. (in Ubuntu, L can be replaced with LF in Redhat)
Q-use? Instead of characters that cannot be exported.
-R sorts the directory backwards.
-S prints the size of the file after each file name.
-T is sorted by time.
-U sorts the time the file was last accessed.
-X output by column, sorted horizontally.
-a list except for. and. All directories and files outside of the
-B does not output a backup file ending in ~.
-C output By column, arranged vertically.
-G output file for the group information.
-l lists the link file name instead of the file that is linked to.
-N Unlimited file length.
-Q Enclose the file name of the output in double quotation marks.
-r lists all the files under subdirectories.
-S is sorted by file size.
-X sorts with the file's extension (the last character after the.).
-11 lines output only one file.

--color=no does not display a color file name.
The--HELP displays help information on the standard output.
The--version outputs the wrong version information on the standard output and launches it.

The LS command for Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.