Linux ls Command detailed

Source: Internet
Author: User

LS Common command parameters

LS:-F to add different representations to different files, add hats

d/l* =s

-A: Show files with hidden files starting with.

-P: Add to directory Only/

-T: Sort by modified time

--time-style=long-iso:ls-l--time-style=long-iso display friendly long format time

-R: Backwards sort Reverse

-S: Sort by file size

-H: Shown in the range of human understanding

-I: Index node (directory of the inode== book) print the index number of each file (the kernel differs by this file whether the files are the same)

Ls–l File Display content analysis
First column: File type (10 characters total) + permissions  --man Find search type to see-: Normal file D: Directory C: Character device-/dev/tty   such as USB interface, CAT, etc. serial port device B: Block device --  and/dev to find, for example, the optical drive, the hard disk, etc.: SELinux related l: Link file--Soft Connect second column: Number of hard links default starting from 1  if it is a directory, the default is 2 (directory does not make hard links) The third column: The file belongs to the main fourth column: The genus Group Fifth column: File size 第六-八 column: Creation time/Last modified time nineth column: file name

Attached: File type "man find search type to see"

Commonly used commands are shown:

Sort by chronological order

Ls-ltr H.txt  

Add color to the output file, not the entire line output color

Ls-l--color=auto  

Show only Directories

Ls-l | grep "^d"   ==>ls-lf | The grep "/$"  directory is followed by a slash to clearly indicate the directory ==>ls-ld */

Show files beginning with numbers

LS [0-9]*

File Installation size Flashback:

   Ll-hsr

List all files and directories under the/HOME/OMC folder for more information

Ll-r/HOME/OMC

List the absolute path of the file in LS "Replace with pwd command after finding the file"

ls | Sed "s#^# ' pwd '/#"

Lists the absolute path to all files (including hidden files) in the current directory, without recursion to the directory

Find/home/omc-maxdepth 1 |xargs ls-ld

Common alias settings for LS

Alias l= ' Ls-alf '

Linux ls Command detailed

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.