Common basic commands in Linux: ls Al Vim permission Modification

Source: Internet
Author: User
Tags control characters printable characters

Common basic commands in Linux-ls favorites
These are frequently used and powerful commands in Linux, but although you may be using these commands every day, I believe you do not fully understand these commands. If so, then you will surely gain something after reading. Let's take a look at the LS command.

The LS command is used to display the content of a file directory.

Synopsis
Ls [Option]... [file]...

List the contents of all directories. If a directory is specified at the end, the contents of the current directory are listed by default and the results are sorted properly.

The following are available parameter options for this command:

-A, -- all
List all files. Do not ignore files starting.

-A, -- almost-all
List all files except .. and ..

-- Author
Used with the-l parameter to display the author of each file

-B, -- escape
Output invisible characters in octal

-- Block-size = size
Use size-byte Blocks

-B, -- ignore-backups
Do not list implied entries ending ~

-C with-lt: sort by, and show, ctime (time of last modification
File status information) with-L: Show ctime and sort by name
Otherwise: sort by ctime

-C list entries by columns

-- Color [= when]
Control whether color is used to distinguish file types. When
May be 'never ', 'Always', or 'auto'

-D, -- directory
List Directory entries instead of contents, and do not derefer ‐
Ence Symbolic Links

-D, -- Dired
Generate output designed for Emacs 'd d Mode

-F do not sort, enable-Au, disable-ls -- color

-F, -- classify
Append indicator (one of */=> @ |) to entries

-- File-type
Likewise, Except t do not append '*'

-- Format = word
Using SS-X, commas-M, horizontal-X, long-L, single-column-1,
Verbose-L, vertical-C

-- Full-time
Like-l -- Time-style = Full-ISO

-G is the same as-l, but does not list the object owner.

-- Group-Directories-first
Put the directories together in front of the file

-G, -- no-group
In a long listing, don't print group names

-H, -- human-readable
Used together with the-option to output the file size in a way that people can understand (for example, 1 K 234 M 2g)

-- Si uses 1000 instead of 1024 to calculate the file size.

-I, -- ignore = Pattern
Do not List objects whose names match the specified regular expression.

-K is equivalent to-block-size = 1 K

-L use long format output

-L, -- Dereference
Display the file corresponding to the linked file

-N, -- Numeric-UID-gid
Same as the-l parameter, but lists the user's ID and group ID

-N, -- literal
Do not modify the output result (for example, do not convert the control operator in the output result)

The-O and-l parameters are the same, but the group information is not listed.

-P, -- indicator-style = slash
Add a/after the directory entry to indicate that this is a directory

-Q, -- hide-control-chars
Hide control characters. Use? Replace all non-printable characters

-- Show-control-chars
Unchanged output non-printable characters

-R, -- reverse
Reverse Order during sorting

-R, -- Recursive
Recursively list the contents of all subdirectories

-S, -- size
The previous block definition size outputs the size of each file.

-S sort by file size

-- Sort = word
Files are not sorted by file name, but by word. Where word can be none (-U), extension (-x), size (-S ),
Time (-T), version (-V)

-- Time = word
It is used with-L to display the time in word instead of the modification time. Where word can be atime
(-U), access (-U), use (-U), ctime (-c), status (-C ); if -- Sort = Time is specified, it is sorted by the specified word time.

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.