Linux one step---ls command

Source: Internet
Author: User

# # #以下使用的部分路径参数禁止未成年人观看 # #

1 command function (brief description):

Lists all files and directories under the current directory or in the specified directory , and LS is the abbreviation for list.

2 Command syntax:

ls "option" "Directory Name" #注: "" In the content is not required option

3 command options (only common command parameters are described):

-a lists all files in the directory, including hidden files that begin with the. -A equals to--all

-a shows. and. All files except the.

-D Displays the directory's own properties without displaying the files under the directory.

-l list details of directories or files

The-H and-l parameters are used to display the file size in a human readable manner, and more humane display results, such as 1k,2m,3g

-I displays inode information for a file or directory, that is, index information

-T sort by modified time display file or directory (time from near sort)

-s sort by file size, from large to small

-R used with other parameters to reverse the sort

--color=auto let the content of the output display color according to the category (there are also parameters in grep)

4 Usage Examples:

    • Displays all files under the specified directory, using Ls-al to specify the path directory, listing/home/japan directory file information

    • Displays all files (including hidden files) under the current directory, using LS-A to list/home/japan directory file information

    • Displays details of all files and directories in the/home/japan directory, using Ls-al, to list/home/japan directory file details

Ls-al the results of the display

First column: 1 The first letter of D means that the content is a directory, such as the Linux directory in, the first letter is - when the content is a file, such as in the Happy.txt; the first letter is l means that the content is a linked file.

2 The following 9 characters represent the permissions of the file or directory, the letter R W x represents the Read, write, execute permission, respectively, the corresponding permission number is 4 2 1. The first 3 represent the permissions of the file or directory that have this permission, and the last 3 represent the permissions of all the groups in the file or directory, and the other person's access to the

Second column: The number of links representing a file or directory, that is, the directory or file contains several directories or the number of files.

Column Three: Represents the owner of a file or directory.

Column Fourth: All groups representing the file or directory.

Fifth Column: Represents the size of a file or directory, in bytes (byte)

Sixth column: Represents the last modification time of a file or directory (using [Stat file name or directory name] to view the access time of a file or directory access, the modified time of a file or directory modify, the change in the state of a file or directory)

Seventh: Represents the file name or directory name

    • Lists the directory details under the current directory without displaying the files, available through the ls-d */command, such as listing directories under the/home/japan directory

    • Displays the Inode (index) information for a file or directory under Directory/home/japan, via the Ls-il command, such as displaying files or directories under/home/japan

    • The display is sorted by the LS-LT command, such as displaying files or directories under/home/japan.

    • Reverse Sort by modification time, by ls-ltr command, such as displaying files or directories under/home/japan

    • Sort from large to small according to the size of the file, you can use the LS-SL command, such as displaying files or directories under/home/japan

    • Sort from small to large according to file size, through LS-SLR commands, such as displaying files or directories under/home/japan

Linux one step---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.