Linux Common commands Brief--ls

Source: Internet
Author: User
Tags locale posix readable

First, LS introduction

The LS command is a short list that displays the list of files and folders in the specified directory; The LS command can not only view files contained in a Linux folder, but also view file permissions, directory information, etc.

Second, the introduction of common options

1. Command format

ls [options] ... [File | directory]:

2. Common options

-A,--all does not hide anything. Start of Project

-A,--almost-all list except. And: Any item other than

--author and-L lists the author of each file when used simultaneously

-C mate-lt: Sorts and displays ctime based on CTime (file

Time the state was last changed)

Mate-L: Show CTime but sort by name other things: Sort by ctime

-c list items from top to bottom of each column

--color[=when] Controls whether to use color-resolved files. When it can be

"Never" (default), "Always" or "auto" one of them

-D,--directory lists the directory itself instead of files within the directory when the directory is encountered

-F not sorted,-au option is active,-lst option is invalid

-g similar to-l, but does not list owner

--group-directories-first

Groups the directory before the file. This option can be used with--sort,

However, grouping is disabled once you use--sort=none (-u)

-G,--no-group in the form of a long list, does not output group name

-H,--human-readable with-l output file size in an easy-to-read format

(e.g. 1K 234M 2G shown in human readable manner)

--si similar to above, but uses 1000 as the base instead of 1024

-H,--dereference-command-line

A symbolic link that follows a command row

--dereference-command-line-symlink-to-dir

A symbolic link to a directory that follows a command row

--hide=pattern hiding items that match pattern mode

(-A or-a will override this option)

The--indicator-style= method specifies how to add an indicator to each project name:

None (default), classify (-f), File-type (-P)

-I,--inode displays the inode number of each file

-K is--block-size=1k

-l list information in a longer format

-L,--dereference displays the symbolic link indicating when the file information for the symbolic link is displayed

Object instead of the symbolic link itself information

-m all items are separated by commas and fill the entire row width

-N,--numeric-uid-gid similar to-L, but lists UID and GID number

-O is similar to-l, but does not list information about groups

-p,--indicator-style=slash add notation "/" to the Directory

-Q,--hide-control-chars with "?" Characters in place of characters that cannot be printed

--show-control-chars directly displays characters that cannot be printed (this is the default, unless you call

The program name is "LS" and is the result of the terminal output)

-Q,--quote-name enclose the entry name in double quotation marks

The--quoting-style= method displays the name of the entry using the specified quoting method:

Literal, locale, Shell, Shell-always, C, escape

-R,--reverse order when sorting

-R,--recursive recursively display subdirectories

-S,--size displays the size of each file allocation as a block number

-s sort by file size

--sort=word The following are optional WORD and the corresponding options they represent:

Extension-x status-c

None-u time-t

Size-s Atime-u

Time-t Access-u

Version-v Use-u

--time=word and-L display the time that WORD represents instead of when it is modified

Room: atime, Access, use, ctime, or status; plus

The--sort=time option takes the specified time as the sort key

--time-style=style and-l display time in the same format as the style represents:

Full-iso, ISO, Locale, Posix-iso, +format.

Format is the time form used for "date";

It's format1<. >FORMAT2,FORMAT1 for older

Files and FORMAT2 for newer files; if the style

Starting with "posix-", the style is only outside the POSIX language family

Effect.

-T Sort by modified time

-T,--tabsize= width Specifies the width of tab (tab), not 8 characters

-T Sort by modified time

-T,--tabsize=cols specifies the width of the tab (tab) instead of 8 characters

-U with-lt: sorted by access time and displayed

Use with-L: Show access time and sort by file name

Other: Sort by access time

-U is not sorted; list items in catalog order

-V Natural ordering of numbers (versions) in text

-1 list only one file per line

Help display this help message and leave

–version display version information and leave

3, for example Ls-lh/etc/sysconfig

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9A/51/wKioL1lUYGXi6fI8AABl6EAMvqk695.png "title=" Qq20170628163631.png "alt=" Wkiom1ltaqqyj1cbaabl6eamvqk033.png-wh_50 "/>

From the above you can know that the-l option means to list information using a longer format-h option means to display in a human-readable way

From, you can see a total of 7 paragraph options

    • The first paragraph is the type and permissions of the file

A total of 10 fields

    1. The first character represents the type of file-indicates that it is a generic file d indicates a directory C is a string file B means that it is a block file L means a linked file

    2. The following nine represents the permissions of the user to the first three owners of the file three are the permissions of the group and the last three are the permissions of the other person

R = Read Available number 4 indicates

W indicates that the write available number 2 indicates

X represents the execution of the available number 1

    • The second segment is the number of hard connections to the file

    • The third paragraph is who owns the file.

    • The fourth paragraph is the name of the group that owns the file

    • The fifth paragraph is the size of the file

    • The sixth paragraph is the creation of the file or the last modification time

    • The seventh paragraph is the name of the file

4, for example, check/etc/sysconfig/networking

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9A/50/wKiom1lUX4qCVXGOAAAMTK20VqA658.png "title=" Qq20170629095923.png "alt=" Wkiom1lux4qcvxgoaaamtk20vqa658.png "/>

The file is the directory permission is 755 connection said to be 4 owner is the root group is the root size is 4K

Created or modified date is 2016/5/11 name is networking


Linux Common commands Brief--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.