"Linux command" ls command

Source: Internet
Author: User
Tags parent directory

The LS command is the most commonly used command of Linux, and the LS command is the abbreviation for list, the main function is: Print out the current directory of the list. If LS specifies a different directory, then the list under the specified directory is displayed.

1. Command format

ls [options] [directory name]


2. Command function

List all subdirectories and files under the directory


3. Common parameters

-A all out of all directory files, including the. Example of a hidden file at the beginning : Ls-a

-A with-a, but not listed "." (represents the current directory) and ".." (Represents the parent directory of the current directory) Example: Ls-a

-C mate –lt: Sort display according to CTime (ctime file last change time) mate-L: Show CTime but sort by name otherwise according to CTime sort example:ls–clt

-c list items from top to bottom examples: ls–clt

--color[=when] control whether to use color-resolved files when can be ' never ', ' always ', ' auto ' one of the examples: LS--color= ' never '

-D Displays the directory as if it were a file, rather than showing the file under it example: Ls–d

Example of the result of using-d–dired to produce dired patterns suitable for emacs : Ls–d

-F do not sort the output files example: Ls-f

-g similar to –l, but does not list owner example: Ls-g

-G does not list any information about the group example: Ls–gls

-H list file size in an easy-to-understand format example: Ls–lsh

-si is similar to-H, but the file size takes 1000 of the time instead of the 1024x768 example: Ls–lsi

-H use symbolic links in the command column to indicate the true destination example: Ls-h

-I,-incode prints the incode number of each file example: Ls-i

-K means the size of the file in the form of a byte. Example: Ls-k

-l lists the permissions, owner, file size, and so on, in addition to the file name. Example: Ls–l

-l,–dereference when displaying the file information for a symbolic link, displays an example of the information indicated by the symbolic link instead of the symbolic link itself : ls–l

-m all items are separated by commas and fill the entire row width example: ls-m

-R traversal lists all subdirectory layer examples: ls–r

-r–reverse Sequence Example: Ls–r

-s sort by file size Example: Ls–s

-t sort by file modification time example: Ls-t

-U mate-lt: Show access time and sort by access time

Mate-L: Show access time but sort by name

Otherwise: Sort by access time Example: Ls-u

-U is not sorted; List project examples in the order of the file system : Ls-u

-V Sort by version example: Ls-v

-W,–WIDTH=COLS Specifies the screen width without using the current numerical example: Ls-w

-X line-by-row listing of items instead of column-wise examples: ls-x

-x Sort by extension example: Ls-x

-1 Only one file per line example: Ls–l

–-HELP Display this help message and leave an example: Ls–help

–-version display version information and leave example: Ls–version

"Linux command" ls command

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.