Linux Common basic Command ls

Source: Internet
Author: User

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/4F/wKioL1Y2N9GT9xJUAAH1N4vz_5g618.jpg "title=" ls.jpg "alt=" Wkiol1y2n9gt9xjuaah1n4vz_5g618.jpg "/>

ls list file names and permissions under files or directories

    • command function:ls (list directory contents) lists file names and permissions under files or directories, and the LS command can not only view Linux Folders contain files and can also view directory information such as file permissions ( including directories, folders, file permissions ) . The LS command is used in a lot of everyday Linux operations !

    • Command format:

[[Email protected] ~] #ls "Options" directory path

    • Command parameters:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/75/51/wKiom1Y2OdHjPk_BAAIXpoWHYlc937.jpg "style=" float: none; "title=" ls command parameter -1.jpg "alt=" Wkiom1y2odhjpk_baaixpowhylc937.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/75/4F/wKioL1Y2OgzCE2QpAAEtMxR8LQo528.jpg "style=" float: none; "title=" ls command parameter -2.jpg "alt=" Wkiol1y2ogzce2qpaaetmxr8lqo528.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/51/wKiom1Y2OdHiW2WjAAJ9kTDaVX4906.jpg "style=" float: none; "title=" ls command parameter -3.jpg "alt=" Wkiom1y2odhiw2wjaaj9ktdavx4906.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/4F/wKioL1Y2Ogyz0PoIAAE9sXXgX6A490.jpg "style=" float: none; "title=" ls command parameter -4.jpg "alt=" Wkiol1y2ogyz0poiaae9sxxgx6a490.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/75/51/wKiom1Y2OdGAlbC-AAIs4dhqfUc273.jpg "style=" float: none; "title=" ls command parameter -5.jpg "alt=" Wkiom1y2odgalbc-aais4dhqfuc273.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/75/4F/wKioL1Y2OgyxyIsBAAEVcJBKOYg824.jpg "style=" float: none; "title=" ls command parameter -6.jpg "alt=" Wkiol1y2ogyxyisbaaevcjbkoyg824.jpg "/>

    • Command instance:

Example 1: Displays all files and directories under the specified directory, and also lists all the "." the hidden file at the beginning.

[Email protected] test]# ls-a. .. ABC test1 test2 test3 test4 test5


Example 2: Displays all files and directories under the specified directory, but does not list all "." the hidden file at the beginning.

[Email protected] test]# ls-aabc test1 test2 test3 test4 test5


Example 3: Displays the file's morphology, permissions, owner, file size, last modified time, full name of the file (file name + extension ). The display format displays one file or directory per line.

[Email protected] test]# ls-ltotal 24-rw-r--r--. 1 root root 0 Nov 1 23:42 a.askdrwxr-xr-x. 7 root root 4096Nov 1 14:32 abc-rw-r--r--. 1 root root 0 Nov 1 23:41 bbb.txt-rw-r--r--. 1 root root 0 Nov 1 23:41 c.txtdrwxr-xr-x. 2 root root 4096Nov 1 14:09 test1drwxr-xr-x. 3 root root 4096Nov 1 14:15 test2drwxrwxrwx. 2 root root 4096Nov 1 14:18 test3drwxr-xr-x. 2 root root 4096Nov 1 14:22 test4drwxr-xr-x. 3 rootroot 4096 Nov 1 14:23 test5


Example 4: Lists the files and their directories in chronological order.

[Email protected] test]# ls-ta.ask c.txt bbb.txt ABC test5 test4 test3 test2 test1


Example 5: If there are still subdirectories or files in the listed directory, the files under all directories are displayed.

[Email protected] test]# ls-r.:a.ask ABC bbb.txt c.txt test1 test2 test3 test4 test5./abc:123 a b c ser./abc/ 123:1 2./ABC/123/1:./ABC/123/2:./ABC/A:./abc/b:./abc/c:e F./abc/c/e:./abc/c/f:./abc/ser:dep./abc/ser/dep:h K. /abc/ser/dep/h:./abc/ser/dep/k:./test1:./test2:test22./test2/test22:./test3:./test4:./test5:test5-1./test5/ Test5-1:

extension:ll is the alias of Ls-l

ll -t is descending, ll -T | TAC is ascending

This article is from the "Ln_linux" blog, make sure to keep this source http://lnlinux.blog.51cto.com/1331535/1708649

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