"Linux command" against the Forgotten-ls command series

Source: Internet
Author: User
Tags sorts


The LS directive can be said to be one of the most commonly used commands under Linux. It has a lot of options, many of which are useful, can you understand? The most options for the LS directive are listed below.
An example of use:
1. List specific documents #ls-al//This is the most commonly used, but often does not completely meet the requirements,
2. List files for all subdirectories: #ls-r//The last instruction only lists all directories and files in this directory, but the files under the directory are not listed in the loop.
3. What if the file is too large to see? And, about the name of a file you want to find in many files.
3.1 split screen display: #ls-l|more//Can be at the time of the screen exit, very useful, but not a page by page flip screen
#ls-l|less//can turn the page with PGUP,PGDW, but cannot exit at that time
3.2 Horizontal Output as many presentation files as possible name: #ls-M
-A lists all files in the directory, including the original hidden files. Common
- m output file name horizontally and "," as a separator.
- C Output file of the I-node correction time, and in this sort.
-R lists the files under all subdirectories.
-L lists the specific information for the file.
-S outputs the size of the file after each file name.
- k Indicates the size of the file in the form of a byte.
- I index information for the I node of the output file.
2. Directory only: #ls-L |GREP ^d 3. Only non-catalog files are displayed: #ls-l |grep ^[^d]
  
3. Sort the output files in various sorts;
3.1 According to the word Fu She (default): #ls-L
3.2 In accordance with the fixed time: #ls-t//recently modified on the top
3.3 Reverse order: #ls-R
3.4 Sort by file size: #ls-S//large file on top
3.5 Sort by file extension (final one. After character): #ls-X
3.6 Sort by number: #ls-lv
-T is sorted by time.
- r Reverse Directory sorting
-f-u The output file is not sorted.
- x Sorts the file's extension (the last character after a.).
-S is sorted by file size.
-U Sorts the last time a file was visited.
  
  
  
-N replaces the title with a digital uid,gid.
- o shows specific information about the file in addition to the group information.
-p-f a character appended to each file name to clarify the type of the file, "*" indicates the generic
" /" indicates the directory; "@" indicates a symbolic connection; "|" Indicate FIFOs; "=" indicates that the set
socket (sockets).
-Q replaces characters that do not output.
.
  
  
  
-X output by column, sorted horizontally.
temporarily useless option:
-B lists the characters in the file name that are not output in the same way as the backslash and character number (as in C speech). Not used
-D shows the directory as a file, rather than the file under it.
-e Outputs the full information of the moment, not the output of the brief information. Useless
-G useless.
-A appears except "." and ".." All the documents outside.
-B does not output a backup file that ends with "~".
-C output by column, sorted vertically.
- g output file for the group information.
-L Lists the connection file name instead of the file to which it is connected.
-N does not constrain file length.
-Q Enclose the file name of the output in double quotation marks.
  
  
  
-11 lines output only one file.
--color=no does not show colorful file names
The--HELP shows assistance information on the specification output.
--version Print information on the spec output and exit[1]



"Linux command" against the Forgotten-ls command series

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.