CentOS Linux system command: LS command

Source: Internet
Author: User



The LS command is an abbreviation for list, a command that lists the contents of a directory or directory, and LS lists the file or directory of the current directory without any parameters.

The LS command allows you to view file permissions (including directories, folders, file permissions) and view directory information with some option parameters.

1), command format:

ls [options] [directory name or file name]

2), Common parameters:

-A, -all lists all files under the directory, including the. The hidden file at the beginning.

-A with- A, but not listed. (indicates the current directory) and: (Represents the top-level directory of the current directory)

-b,-escape lists characters that are not output in filenames by backslash and character numbering

-block-size= size blocks in < size > bytes

-b–ignore-backups does not list any items that end with the ~ character

- C output File CTime (the time the file state was last changed) and sorted according to CTime

- C list items from top to bottom of each column

-color[=when] Controls whether to use color-resolved files. When can be ' never ', ' always ', or ' auto ' one of them

-d,-directory Displays the directory like a file, rather than displaying the file under it.

- g similar to-l, but does not list owner

-g,-no-group does not list any information about the group

-h,-hunman-readable Lists the size of the file in an easy-to-understand format.

-i,inode Lists the inode number for each file.

- m all items are separated by commas and fill the entire row width.

-n,-numeric-uid-gid is similar to-l, with a numeric Uid,gidd instead of a name.

- o similar to-L, showing details of files in addition to group information

-p,-f A character appended to each file name to indicate the type of the file, "*" indicates the executable ordinary file;

"/" means directory; "@" denotes symbolic link; "|" Represents FIFOs; "=" represents a socket.

-r,-reverse listing all subdirectory tiers at the same time

-s,-size to list the size of all files in block size

- s Sort by file size

- t sorted by file modification time

- u consolidates –lt; shows access time and sorts by access time.

3), commonly used examples:

1), lists the details of all files and directories under the folder under the user's home directory (root).

Command: ls–lr/root/

2), list the details of the current directory, and display the size in an easy-to-read manner

Command: LS–LH


This article is from the "Eight Miles Bridge" blog, please be sure to keep this source http://baliq.blog.51cto.com/5984262/1688188

CentOS Linux system command: LS command

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.