Linux LS command

Source: Internet
Author: User

Usage: ls [Option]... [file]...
List the <File> information (the current directory by default ).
If-cftuvsux or -- sort is not specified, it is sorted by letter size.

Parameters required for long options are also required when short options are used.
-A, -- all does not hide any project that starts with a. character.
-A, -- almost-ALL: list all projects...
-- Author and-l list the authors of each file at the same time
-B, -- escape represents unprintable characters in an octal overflow Sequence
-- Block-size = The Size Block is in the unit of specified <size> bytes.
-B, -- ignore-backups does not list any ~ Project ended with a character
-C combination-lt: sort and display ctime by ctime (File
Time when the status was last changed)
Combined with-L: ctime is displayed, but sorted by name
Otherwise: sort by ctime
-C. List projects from top to bottom in each column
-- Color [= when] controls whether to use color to distinguish files. When can be
"Never", "always", or "Auto"
-D, -- Directory: list the files in the directory rather than in the directory when a directory is encountered.
-D, -- Dired generates results suitable for the Dired mode of Emacs
-F is not sorted, the-Au option takes effect, and the-LST option is invalid.
-F, -- classify plus the file type indicator (*/= @ | one of them)
-- Format = Keyword: publish SS-X, commas-M, horizontal-X, long-l,
Single-Column-1, verbose-L, vertical-C
-- Full-time:-l -- Time-style = Full-ISO
-G is similar to-l, but does not list owners
-- Group-Directories-first
Before grouping a file, group the directory first.
-G, -- no-group is in the form of a long list, and no group name is output
-H, -- human-readable and-l together to print the file size in an easy-to-read format
(For example, 1 K 234 M 2g)
-- Si is the same as above, but the base is 1000 instead of 1024.
-H, -- dereference-command-line
Symbolic Links listed by the command line
-- Dereference-command-line-symlink-to-Dir
Symbolic Links to directories listed by the command line
-- Hide = pattern: hide a project that meets the pattern.
(-A or-A will overwrite this option)
-- Indicator-style = specifies that an indicator is added after each project name <mode>:
None (default), classify (-F), file-type (-P)
-I, -- inode indicates the inode number of each file
-I, -- ignore = the style does not print any project that meets the shell universal character <style>
-K is -- block-size = 1 K
-L use a long format to list information
-L, -- dereference: when the file information of the symbolic link is displayed, the symbolic link indicates
Object instead of the information of the symbolic link.
-M all items are separated by commas (,) and the whole row width is filled.
-N, -- Numeric-UID-GID is similar to-l, but UID and GID are listed.
-N, -- literal: Print unprocessed project names (for example, do not specially handle control characters)
-O is similar to-l, but does not list information about the group.
-P, -- indicator-style = slash: add the symbol "/" to the directory.
-Q, -- hide-control-chars? Replace the characters that cannot be printed
-- Show-control-chars: displays unprintable characters directly (this is the default mode unless you call
The program name is "ls" and the result is output on the terminal screen)
-Q, -- quote-name enclose the entry name in double quotation marks
-- Quoting-style = use the specified quoting <mode> to display the name of the entry:
Literal, locale, Shell, shell-always, C, escape
-R, -- reverse sorting
-R, -- Recursive recursively lists all subdirectories
-S, -- size and-l are used simultaneously to list the size of each file in blocks.
-S sort by file size
-- Sort = below is an 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 = when both word and-l are used, the time represented by word is displayed instead of the time when it is modified.
: Atime, access, use, ctime, or status; and
-- Sort = time takes the specified time as the sorting keyword.
-- Time-style = when using style and-l simultaneously, the time is displayed according to the format represented by style:
Full-ISO, ISO, locale, POSIX-ISO, and + format.
Format is the time format used by "date". If format
Yes format1 <New Line> format2, format1 applies to older
While format2 applies to newer files; if the style
If it starts with POSIX-, the style is only outside the POSIX language.
Effective.
-T sort by modification time
-T, -- tabsize = width: Specify the <width> of the tab, rather than 8 characters
-T sort by modification time
-T, -- tabsize = Cols specifies the number of spaces used by the tab
-U with-lt: Display access time and sort by access time
Combined with-L: display the access time, but sort by name
Otherwise: sort by access time
-U is not sorted; items are listed in the original order of the file system.
-V sort by version
-W, -- width = Cols: Specify the screen width without using the current value.
-X: List projects row by row instead of column.
-X sort by extension
-1. Only one file is listed in each row.
-- Help: displays the help information and leaves
-- Version: displays the version information and leaves.

<Size> can be the following units (an integer can be added before the Unit ):
KB 1000, K 1024, MB 1000*1000, M 1024*1024, G, T, P, E, Z, Y.

By default, colors are not used to differentiate files. The -- color = none option is used. If you use
-- Color option, but the when parameter is not specified to be -- color = always. When -- color = auto is used,
Color is displayed only when the output is to the terminal screen (TTY.

If everything is normal, the exit status is 0. If a minor problem occurs, the exit status is 1. If a serious problem occurs, the exit status is 2.

Report errors to <bug-coreutils@gnu.org>.

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.