The LS command in Linux is used in detail

Source: Internet
Author: User
Tags parent directory

The LS command is one of the most commonly used commands under Linux, LS is the same as the dir command under DOS, is used to list the files under the directory, let's take a look at the use of LS

English Full Name: list is the meaning of lists, when we learn something in order to know the reason why, when you know that this thing is probably what the future of your thinking will be associated with a lot of things will soon learn.

1. Ls-a lists all files under the file, including "." The beginning of the hidden file (the Linux file hidden file is preceded by the., if present: Represents the existence of the parent directory).

2. Ls-l lists the details of the file, such as creator, creation time, file read-write permission list, and so on.

3. Ls-f add a character to the end of each file to indicate the type of the file. ' @ ' means symbolic link, ' | ' Represents the FIFOs, "/" for the directory, and "=" for the socket.

4. Ls-s prints the size of the file after each file. Size (sizes)

5. ls-t sort files by Time duration (time)

6. ls-a list except "." and ".." Other than the file.

7. Ls-r lists all subdirectories in the directory, equivalent to the "recursive" implementation in our programming

8. ls-l lists the link names of the files. Link (links)

9. ls-s sort files by size

These are some of the use of the LS command, of course, there are a lot of not listed, we can man a bit. Help to learn English

LS can be combined with pipe symbol "|" For a complex operation. For example: LS | Less is used to implement paging of file list, ls

Calculate the number of files in the current directory

LS-|*|grep "^-" | WC-|

Finally, the meaning of some file colors in Linux files

Green----> representative executable, (green represents the meaning of the pass) hehe

Red----> represent compressed files

Dark blue----> representative catalogue

Light blue-----> on behalf of linked files

Grey----> on behalf of some other files

The LS command in Linux is used in detail

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.