ls, dir, vdir - listed directory contents

ls [options] [filename ...]

POSIX standard options: [-CFRacdilqrtu1]

GNU option (short form):

[-1abcdfgiklmnopqrstuxABCDFGLNQRSUX] [-w cols] [-T cols] [-I pattern] [--full-time] [--format={long,verbose,commas,across,vertical,single-column}] [--sort={none,time,size,extension}] [--time={atime,access,use,ctime,status}] [--color[={none,auto,always}]] [--help] [--version] [--]

Description (DESCRIPTION)


Ls program listed first non-directory file entry, and then every directory
"to display" file. If no arguments other than options [translation:
filename] section is empty appears by default (the current directory). "." Option
term "-d" directory and non-directory entry makes the same treatment. Unless the "-a"
option appears, the file names. "" Beginning of the file does not belong "to display" Wen
pieces.


Subject to the current directory, each group of files (including non-directory file entry, as well as
the directory containing the files of each), respectively, by file name comparison order. If the
"-l" option exists, display a summary file before each line - the given
set of files and the length (512 bytes).


It is output to the standard output (stdout). Unless "-C" option to
seek by multi-column output, the output will be one per line. However, when the output to the terminal,
single-output or column output is uncertain. Options can be respectively "-1"
or "-C" to force or press the single column output.

 

-C
Multi-column output, longitudinal sort.
-F
Each directory name with "/" suffix, each FIFO name with "|" suffix, each running name with "*" suffix.
-R
Recursively list subdirectories encountered.
-a
List all files, including "." At the beginning of the hidden files.
-c
Using the "status change time" instead (when using the "-t" option) "file modification time" as the basis to sort or list (when using the "-l" option).
-d
The directory name is listed as the same as other files, rather than listing their contents.
-i
Before the output file to the output file serial number (i.e., node number i - i-node number). -l Lists (in a single column format) the file mode (file mode), the file number of links, owner name, group name, file size (in bytes), time information, and file name. By default, the time information displays the most recent modification time; time information can be displayed with the other two options "-c" and "-u" option. For the device file, the original file size display area generally denotes the number of primary and secondary (majorand minor device numbers).
-q
The output of non-printing characters in file names as question marks. (For the output terminal which is the default.)
-r
In reverse order.
-t
Sort by time information.
-u
(When using the "-t" option) using the most recent access time instead of the last modified time basis or to sort lists (when using the "-l" option).
-1 single output.

GNU details

If a standard output terminal, the output of the plurality of columns (vertical order).

dir (also installed as a command d) is equivalent to the "ls -C"; i.e., file
The default output is a multi-row, vertical sorting. vdir (also installed as a command v) is equivalent to the "ls -l"; i.e., the default file is output in long format.

GNU Options

-1, --format = single-column line output of a document (single output). As to the standard output is not a terminal, this option is the default option.

-a, --all
Directory lists all files, including the "." At the beginning of the file.
-b, --escape
The list of characters in the file name can not be output with a backslash characters plus numbers (just like in the C language) form.
-c, --time=ctime, --time=status
Press file status change time (ctime i node) and output the sorted directory contents. The use of long output (option "-l"), use of a file status change time unsubstituted file modification time. 【Annotation: The so-called change of file status change (ctime to mark i node), both file is modified, and include the file attributes (such as owner, group, link count, etc.)]
-d, --directory
The directory name is listed as the same as other files, rather than listing their contents.
-f
Do not sort directory contents; list in the order they are stored on disk. At the same time start the "-a" option, if there is prior to "-l" in the "-f", "- -color" or "-s", which is prohibited.
-g ignore, for compatibility with UNIX.
-i, --inode
Print i-node number to the left of each file (also called the file serial number and index number - - file serial number and index number). i-node number is unique to each particular file system.
-k, --kilobytes
As listed in the file size, places kilobytes KB.
-l, --format=long, --format=verbose
In addition to the name of each file, increase the display file type, permissions, number of hard links, owner name, group name, size (byte), and the time information (if no other time is specified refers to modification time). For more than six months beyond the file or files the next 1 hour, the time information in the division will be replaced's.

Before each directory listed, there is a line 'total blocks "shows the disk space occupied by all files in the directory. The default block is 1024 bytes; POSIXLY_CORRECT If the environment variable, unless the "-k" option is used, then the default block size is 512 bytes. Each hard links are included in the total number of blocks (and therefore may repeat count), this is a disadvantage.

Permissions listed are similar to symbology specification (file) mode. But ls
Combined (multiple bits) of the multi-bit information in the third character in each set of permissions, as follows: s If the setuid or setgid bit position, but also the corresponding executable bit set. If the S bit set setuid or setgid bit, but the corresponding executable bit is not set. t If the sticky bit set, but also the corresponding executable bit set. T If the sticky bit set, but the corresponding executable bit is not set. x If the executable bit is set and not only the above four cases. - other cases (to perform bit is not set).
-m, --format=commas
List files horizontally, per line as much as possible, each with a comma and a space-delimited.
-n, --numeric-uid-gid
Listed digitized UID and GID instead of the user and group names.
-O
List directory contents in long format, but do not display group information. Use equals "--format = long --no-group" option. This option is provided for compatibility with other versions of ls.
-p
Attach a file name after each character to illustrate the type of the file. Similar "-F" option but does not denote executable files.
-q, --hide-control-chars
Central African print character file name is replaced by a question mark. This is the default option.
-r, --reverse
Directory contents in reverse order.
-s, --size
It was left in the output file size of each file, in a 1024-byte blocks. If the POSIXLY_CORRECT environment variable, unless "-k" option is used, the block size is 512 bytes.
-t, --sort=time
By File last modification time (mtime i node) but not sorted by file name lexicographical order, the new file forward.
-u, --time=atime, --time=access, --time=use
Similar option "-t", but instead of using file modification time file last access time (atime i node). If you use a long list format, time is the last access time of printing.
-w, --width cols
Screen width is assumed cols (cols substituted actual number) column. If you do not use this option, the default value is obtained in this way: if possible first try to drive from the terminal, otherwise attempt from the environment variable COLUMNS (if set), it will not take 80.
-x, --format=across, --format=horizontal
Multi-column output, lateral sorting.
-A, --almost-all
Show all files except "." And ".." away.
-B, --ignore-backups
No output "~" at the end of the backup file, unless it has been given on the command line.
-C, --format=vertical
Multi-column output, longitudinal sort. When a standard output terminal which is the default. When using the dir command names and d, it is always the default.
-D, --dired
When long format ( "-l" option) output, after the main output, additional print one line: // DIRED // BEG1 END1 BEG2 END2 ...
BEGn and ENDn is an unsigned integer, each file name of the recording start, end position in the output (
Byte offset). This makes it easy to find Emacs file name, even if the file name contains spaces or other non-normal newline character does not need specific search.
If the directory is listed recursively ( "-R" option), a similar line after each subdirectory list:
// SUBDIRED // BEG1 END1 ... [Translation: I tested TurboLinux4.0 and RedHat6.1, they are found in the "// DIRED // BEG1 ..." listed after "// SUBDIRED // BEG1 ... ", that is not the only one there after each subdirectory. And "// SUBDIRED // BEG1 ..." listed is offset each subdirectory name. ]
-F, --classify, --file-type
Attach a file name after each character to illustrate the type of the file. "*" Indicates a normal executable file; "/" indicates a directory; "@" symbolic link; "|" indicates FIFOs; "=" represents sockets (sockets); it means nothing ordinary file.
-G, --no-group
When long format column in the directory does not display information.
-I, --ignorepattern
Unless given on the command line, do not list files that match the file name matches shell type (pattern, it does not refer to the general expression). In the shell, the file name with "." Does not match the initial wildcard in the file name matches the style (pattern) at the beginning of.
-L, --dereference
Lists information file symbolic link points to, not the symbolic link itself.
-N, --literal
Do not cause the file name in quotation marks.
-Q, --quote-name
File name enclosed in double quotes, non-printable characters are represented by Method C language.
-R, --recursive
List the contents of all directories recursively.
-S, --sort=size
Sort by file size instead of lexicographical directory content, large files forward.
-T, --tabsize cols
Assume that each tab width cols. The default is 8. For the sake of efficiency, ls tabs may be used in the output. If cols is 0, no tabs used.
-U, --sort=none
Do not sort directory contents; list in the order they are stored on disk. (Different options "-U" and "-f" is that the former does not start or options related to prohibition.) This column is particularly useful when a large directory, because they do not add significantly speeds up the sorting.
-X, --sort=extension
Lexicographical sort by file extension (characters after the last "." In composition). No extension listed first.
--color[=when]
Specify whether to use color difference file categories. LS_COLORS environment variable to specify the color used. How to set this variable see dircolors (1). when may be omitted, or one of the following:
none Do not use color, which is the default.
auto output is used only when the standard terminal. always always use color. --Color = always equivalent to specifying --color and when omitted.
--full-time
Complete lists of time, rather than using the standard abbreviation. Format as date (1) default format; this format can not be changed, but you can (1) wherein the date string extraction result to the command and the "date -d" with cut.
It comprises a second output time is very useful. (Unix file system stores the time information is accurate to the second file,
Therefore, this option has been given all the information known to the system. ) For example, when you have a Makefile can not generate the appropriate file, this option will help.

GNU Standard Options

--help
Print usage information to standard output and exit successfully.
--version
Print version information to standard output and exit successfully.
--
The end of the option list. 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11089246.html