The LS command in Linux is used in detail

Source: Internet
Author: User
Tags parent directory

Article turned from: http://blog.csdn.net/ansha886/article/details/4426103

Recently in the study of Linux, through the blog park to better comb to strengthen the knowledge learned.

The LS command is one of the most commonly used commands under Linux, and the dir command under LS and DOS is used to list files in the directory. English Full Name: list is the meaning of lists.

1. Ls-a lists all files under the file, including "." The beginning of the hidden file (under Linux file hiding is in.), if present: Represents 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 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 the file by time (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

There's so much more.

LS can be combined with pipe symbol "|" To perform complex operations, such as: ls|less for paging the file list

The meaning of some file colors under Linux files:

Green: Represents an executable file

Red: Represents a compressed file

Dark blue: Representative directory

Light blue: Represents a linked file

Gray: Some other files on behalf of

The LS command in Linux is used in detail

Related Article

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.