One Linux command per day (LS)

Source: Internet
Author: User
Tags control characters locale posix

Premise: The file path is described in only 1 disks, called the root directory/absolute path: The file path described in the root directory, such as/A/B/C. The path description method with the/head must be an absolute path relative to the path: The file path relative to the current path is described in a way that represents the current directory.   Indicates the parent directory current path: The system is currently in the directory is the system's current path, described in the prompt. prompt: [user name @ hostname current path last directory] Rest rest: Normal user is $,root Yes #

The file name file with a. Beginning file is hidden when you include: * denotes any number of characters, or 1 arbitrary characters

Home directory: A user's own directory, similar to the home directory of a user's library in a Windows system: ~ A user's home directory: ~ User name

Ls

Function: Display the file in the specified directory, display the file information, if the file is a directory file, the default display of the directory file information, if the file is empty, the current directory is displayed in the file information, if there is no option, the display file information is the filename

Application Location:/bin/ls

Grammar:ls [options] ... [File] ...
Options:
- D, which means that when the file is a catalog file, the file information in the directory is no longer displayed, but the information for the directory file itself
- L, indicating that all information about the file is displayed in a long-list format, not just the file name
-A,--allIndicates that a hidden file is displayed together with a file that begins with a.
-A,--almost-all list except. And: Any item other than
--author and-L lists the author of each file when used simultaneously
-B,--escape characters that are not printable in an octal overflow sequence
--block-size=size scale sizes by size before printing them. e.g.,
'--block-size=m ' prints sizes in units of
1,048,576 bytes. See SIZE format below.
-B,--ignore-backups do not list implied entries ending with ~
-C With-lt:sort by, and show, CTime (time of the last
Modification of file status information)
With-l: Show CTime and Sort by name
Otherwise:sort by CTime, newest first
-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
-D,--dired produces the results of the dired pattern used for Emacs
-F not sorted,-au option is active,-lst option is invalid
-F,--classify plus an indicator of the file type (*/[email protected]| one)
--format= keyword Interleaved-x, comma separated-m, horizontal-X, long-L,
Single column-1, verbose-L, vertical-C
--full-time i.e.-l--time-style=full-iso
-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)
--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
-I,--ignore=pattern does not display any items that match the specified shell PATTERN
-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
-N,--literal output unprocessed project name (if control characters are not specifically handled)
-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 in reverse order
-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<. &GT;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 modification time, newest first
-T,--tabsize=cols assume tab stops at each COLS instead of 8
-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
-W,--width=cols specifies the screen width without using the current value
-X list items line by row instead of columns by column
-x Sort by extension
-1 list only one file per line

ls-a: Lists all files under this path (including hidden files)

Ls-al (same as direct using ll effect):----A parameter is used in conjunction with the L parameter to display all directories and file details in a long list. Includes file type, file permissions, hard connections, file owner, file group, file size, change time, file name, and so on.

ls-al |more (direct use ll |more) When there are too many files and directories under the folder, a screen display can be combined with pipe character and more command to achieve split screen display

ls-ld lists only the directory details and does not display the files. Sometimes there are too many files and directories under the folder, you can display only the directory with the-D option

ls-r File and directory information displayed in directory and multilevel subdirectories

Ls-il Displays inode information in the first column, which is the file index information

ls-lt sorted by modified time, positive sequence display

ls-ltr sorted by modified time, reversed-order display

One Linux command per day (LS)

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.