Linux command------ls

Source: Internet
Author: User
Tags readable

Common command-->. ls

function

Ls-->list: (List directory contents) is used to display the list information in the contents of the directory, and to distinguish between different file types by color, of course, you can display files to find files.


Syntax

ls [OPTION] ... [FILE] ..., using #man ls to derive command syntax, "[]" means can be omitted, you can use LS alone to display the list information in the directory.


"Option Parameters"

Add select different parameters to display different list information

Option parameters
Description
-a,--all Indicates that all files are displayed, including hidden files, current directory ".", Parent directory ".."
-A,--Almst-all means almost like--all, showing all files including hidden files, but not "." and ".."
-C,--Ctime
Indicates that the file was created in reverse order, followed by the file created earlier
-D,--Directory Represents the list directory itself "." Not part of the department.
-f,--classify Table lists file categories: Normal text files, directory files/, executables *
-F Indicates no difference with-a display but no color distinction, turn off the "lst" parameter effect
--file-type Indicates that the display file is distinguished from the directory,-F to check the executable file,--file can not
--full-time
Indicates the time to display file creation details
-G Represents "Like-l" as long as the format is displayed, but does not show the owner "Ower" of the file
-g,--no-group
Represents the "Like-l" as a long format, but does not display the file group "group", as opposed to-g
-H,--human-readable Indicates a human-readable file size (K, M, G) using "with-l" with long format parameters
-I.,--inode Indicates the number of file and directory inode, some called I node--and the number,
-L
Indicates that the "use a long listing format" is displayed in the detail list
-M
Indicates that the file is displayed separated by ","
-O
Indicates that "Like-l" is displayed in a similar long format, but does not list the genus Group, as with "-G"
-Q Indicates that the file and directory identifiers are displayed in double quotation marks
-R,--Revers Indicates that the file is displayed in reverse order, such as: E D c a mode display
-R,--Recursive Represents a recursive process that handles all files and sub-files in the specified directory
-U Represents the last time access to the sort, displaying directories and files
The above is the LS section display files and directories need to use parameters, to check more man ls


"File Type"

Use the command #ls-l to display: "-rw-r--r--" here a total of 10 bits, the first bit for the file type is identified as

Name Identifier
Normal file -rw-r--r--
Directory
drwxr-x---
Character device/block device file crw-------/brw-------
Symbolic Link File Lrwxrwxrwx
Set Broken file srwxrwxrwx
Command Pipeline file Pipe
Prw-r--r--


"Instance 1"

Displays all the files in the directory, including the current directory "." and parent directory ".."

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/93/wKiom1WgyHzTJQX-AAFy7-Ios8o926.jpg "title=" Ls-a " alt= "Wkiom1wgyhztjqx-aafy7-ios8o926.jpg"/>

"Instance 2"

Display a file or directory in reverse order of creation time

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/92/wKiom1WgsjeyidsxAAC_Xtn9Fvk015.jpg "title=" Ls-c " alt= "Wkiom1wgsjeyidsxaac_xtn9fvk015.jpg"/>

List the time in reverse order so that you know that the file is the last face new and reversed

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/8F/wKioL1WgtQSQ5Y1XAALtQnPtSn4142.jpg "title=" Ls-lt " alt= "Wkiol1wgtqsq5y1xaaltqnptsn4142.jpg"/>


"Instance 3"

Using the command ls-ld to display the target directory, ls-d can only display its own directory, and "L"; Ls-ld can know the target directory

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/8F/wKioL1WgtkijZm09AADnMaP80mA170.jpg "title=" Ls-ld " alt= "Wkiol1wgtkijzm09aadnmap80ma170.jpg"/>


"Instance 4"

Use a command to display a different file type as a symbol

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/8F/wKioL1WguArDe3SsAAClBARBSnI957.jpg "title=" Ls-f " alt= "Wkiol1wguarde3ssaaclbarbsni957.jpg"/>


"Instance 5"

Use the command to show the details of when the file was created

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/8F/wKioL1WguKmyeZTIAASGDGtCvOY835.jpg "title=" LS-- Full-time "alt=" Wkiol1wgukmyeztiaasgdgtcvoy835.jpg "/>


"Instance 6"

Does not display the owner of the file,-G does not show the owner,-G does not display a group,-O does not display a group,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/8F/wKioL1WgukbQCQekAAIQ8SCEI80010.jpg "title=" Ls-g " alt= "Wkiol1wgukbqcqekaaiq8scei80010.jpg"/>


"Instance 7"

From the above several examples are not difficult to see the size of the file read/or difficult to read, how to display the size of the file can be read at a glance

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/90/wKioL1Wgu4OSe9OuAAJLKwAnPvg452.jpg "title=" LS-LH " alt= "Wkiol1wgu4ose9ouaajlkwanpvg452.jpg"/>


"Instance 8"

Display file number (file ID number, file I node, file I number, called different) inode

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/90/wKioL1WgvFeBkm1bAAOllAV_xJA064.jpg "title=" Ls-li " alt= "Wkiol1wgvfebkm1baaollav_xja064.jpg"/>


..........................................

LS is used in conjunction with a wildcard character

Using wildcard characters is generally used in the case of fuzzy memory of filenames


Wildcard characters
Symbol Description
* Matches the file name of any character of any length
? Match any single character
[] Match the characters in []
[!] Match Reverse


"Instance 1"

Displays the file name beginning with T or the file ending with 3, and the filename is arbitrarily long

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/93/wKiom1WgwavBFJL3AAF4GX7PYCo398.jpg "title=" ls A * ls "alt=" Wkiom1wgwavbfjl3aaf4gx7pyco398.jpg "/>


"Instance 2"

Show files ending in est*

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/90/wKioL1WgxEHj6ANGAAFDoBW__JA036.jpg "title=" 10.png "alt=" Wkiol1wgxehj6angaafdobw__ja036.jpg "/>


"Instance 3"

The display file name consists of four characters, the first of which is the letter, and the next three has a number.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/90/wKioL1Wgxc3RTIArAAFTv0ltFRE985.jpg "title=" 11.png "alt=" Wkiol1wgxc3rtiaraaftv0ltfre985.jpg "/>


"Instance 4"

Displays a file beginning with the English alphabet and a value range of a-t, followed by any number but a file with a number ending in the file

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/93/wKiom1WgxS3hlAUdAAFAAU8wZY0013.jpg "title=" 12.png "alt=" Wkiom1wgxs3hlaudaafaau8wzy0013.jpg "/>


"Instance 5"

Displays a file that begins with an English letter, with any character in the middle, but with a file name that does not follow the number at the end

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/93/wKiom1WgxeuBmAVqAAFUFUxV9vg238.jpg "title=" 13.png "alt=" Wkiom1wgxeubmavqaafufuxv9vg238.jpg "/>

This article is from the "Falcon" blog, please make sure to keep this source http://duying.blog.51cto.com/10484057/1673220

Linux command------ls

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.