Linux ls command

Source: Internet
Author: User

The LS command is the most commonly used command under Linux. The LS command is the abbreviation of list, the lack of saving LS is used to print out the current directory of the list, if LS specifies a different directory then will be displayed in the specified directory of files and folders list. The LS command not only allows you to view the files contained in a Linux folder, but also to view file permissions (including directories, folders, file permissions), view directory information, and more. The LS command is used in a lot of everyday Linux operations!

1. command format:

ls [options] [directory name]

2. command function:

Lists all subdirectories and files in the destination directory.

3. Common parameters:

(1)-a--all displays all files and directories, including hidden files with the. Start or .

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8A/40/wKioL1gsEqeyVFM5AAA2Pn82_WI914.png-wh_500x0-wm_3 -wmp_4-s_1329969785.png "title=" yw@ @I4]dk8 ' sfh62k~93i4j.png "alt=" Wkiol1gseqeyvfm5aaa2pn82_wi914.png-wh_50 "/>

(2)-a lists all files and directories as-A and removes the current directory (.) and current parent directory (..)

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8A/44/wKiom1gsE7igqTexAAArSbkzWW0354.png-wh_500x0-wm_3 -wmp_4-s_1401865426.png "title=" Nefok}{eiwa3z91dmm3}zss.png "alt=" Wkiom1gse7igqtexaaarsbkzww0354.png-wh_50 "/>

(3)-L--list display of ls-l abbreviations in a list of LL

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8A/41/wKioL1gsFnmDz6uFAABwQ8pEZLc008.png-wh_500x0-wm_3 -wmp_4-s_194721151.png "title=" p~um{ms1) hd[[(0hq~z~gr3.png "alt=" Wkiol1gsfnmdz6ufaabwq8pezlc008.png-wh_50 "/>

(4)-T is sorted with the change time of the file and the directory, generally combined with-L or ll-t

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8A/45/wKiom1gsH8fgdJ9nAAA1PwnHCkQ327.png-wh_500x0-wm_3 -wmp_4-s_3057397161.png "title=" 2016-11-16_165800.png "alt=" Wkiom1gsh8fgdj9naaa1pwnhckq327.png-wh_50 "/>

(5)-C with the "-lt" option, the output directory content is sorted according to the file status time, sorted by the CTime field in the index node of the file. When in conjunction with the "-l" option, the ordered sentence is the state change time of the file

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/42/wKioL1gsIQXgUzxeAAAY-HFFviI528.png-wh_500x0-wm_3 -wmp_4-s_3149587621.png "title=" 2016-11-16_165800.png "alt=" Wkiol1gsiqxguzxeaaay-hffvii528.png-wh_50 "/>

(6)-F appends the type identifier of the file to each output item, meaning: "*" means a normal file with executable permissions, "/" for the Directory, "@" for the symbolic Link, "|" Represents a command pipeline FIFO, and "=" represents a sockets socket. Do not output any identifiers when the file is a normal file

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8A/42/wKioL1gsIeXhyjwlAABJtikyJe4616.png-wh_500x0-wm_3 -wmp_4-s_2229121553.png "title=" 2016-11-16_170648.png "alt=" Wkiol1gsiexhyjwlaabjtikyje4616.png-wh_50 "/>

(7)-B outputs a non-output character in a file with a backslash "" and a character encoding

(8)-D displays only the directory name, not the list of contents under the directory. Displays the symbolic link file itself without displaying the list of directories it points to

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/46/wKiom1gsIunDEfkoAAAMG8jkheA570.png-wh_500x0-wm_3 -wmp_4-s_1979467522.png "title=" 2016-11-16_171122.png "alt=" Wkiom1gsiundefkoaaamg8jkhea570.png-wh_50 "/>

(9)-F This parameter has the same effect as specifying the "AU" parameter, and turns off the effect of the-l parameter

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8A/42/wKioL1gsJPjRaKWLAAAdxtHFDO4948.png-wh_500x0-wm_3 -wmp_4-s_133605934.png "title=" 2016-11-16_171643.png "alt=" Wkiol1gsjpjrakwlaaadxthfdo4948.png-wh_50 "/>

(Ten)-I: Displays the file index node number (inode). An index node represents a file

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8A/42/wKioL1gsJNXCI_ezAAAh3NhmvRk709.png-wh_500x0-wm_3 -wmp_4-s_2335997969.png "title=" 2016-11-16_172002.png "alt=" Wkiol1gsjnxci_ezaaah3nhmvrk709.png-wh_50 "/>

(one)-I: Displays the file index node number (inode). An index node represents a file

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8A/51/wKioL1gtaO-AXfTtAAAicXDFJss509.png-wh_500x0-wm_3 -wmp_4-s_3792089637.png "title=" 2016-11-17_162252.png "alt=" Wkiol1gtao-axfttaaaicxdfjss509.png-wh_50 "/>

()-R: recursively handles all files and subdirectories under the specified directory

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8A/51/wKioL1gtaK3g9du6AAATfC1PJvM137.png-wh_500x0-wm_3 -wmp_4-s_2710673526.png "title=" 2016-11-16_165800.png "alt=" Wkiol1gtak3g9du6aaatfc1pjvm137.png-wh_50 "/>

(+)-K: Displays the file size in kilobytes (Kbytes)

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/51/wKioL1gtaWmjqc01AAA7MnmDC-E750.png-wh_500x0-wm_3 -wmp_4-s_1522625639.png "title=" 2016-11-17_162458.png "alt=" Wkiol1gtawmjqc01aaa7mnmdc-e750.png-wh_50 "/>

(+)-r: Sorts and outputs the list of directory contents in reverse order of file name;

             650) this.width=650; "Src=" http://s1.51cto.com/wyfs02/M00/8A/55/wKiom1gtad-zhK6HAABFon2ubXk715.png-wh_500x0-wm_3-wmp _4-s_2506140487.png "title=" 2016-11-17_162657.png "alt=" Wkiom1gtad-zhk6haabfon2ubxk715.png-wh_50 "/>             

                    

(+) - m: the name of each file and directory separated by the "," area;

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8A/51/wKioL1gtanuS7by6AAAdUvG6Wf4422.png-wh_500x0-wm_3 -wmp_4-s_3070108608.png "title=" 2016-11-17_162857.png "alt=" Wkiol1gtanus7by6aaaduvg6wf4422.png-wh_50 "/>

(+) -N: The name of each file and directory separated by the "," area;

()-L: If you encounter a file or directory of a symbolic link, directly list the original file or directory that the link points to;







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