LINUX file attributes
~ $ ls -al
The file generally has 10 attributes.
first row:
The first attribute:
[d], directory
[-],file
[l], link file
[b], the interface device available for storage in the device file
[c], the serial port device in the device file, such as keyboard and mouse
Next, a group of 3 bits, 3 parameter combinations of "rwx".
[r], readable read
[w], write
[x], execute excute
The first group: owner's authority
The second group: the permissions of the same user group
The third group: other non-user group permissions
Note: The extension under windows determines whether it can be opened, such as .exe. Under LINUX, it is determined by whether it has the [x] attribute, and has no absolute relationship with the file name.
The second column: indicates the node i-node occupied by the connection: related to the connection file.
The third column: the owner of the file or directory
Fourth column: user group where the owner is
Fifth column: file size
Sixth column: the creation date or the most recent modification date I saw
Seventh column: file name. Precede "." To indicate hidden files.
ls detailed usage:
-a, --all do not hide any project begins.
-A, --almost All-listed and any project other than the ...
list of each file --author when used simultaneously with the -l
- b, --escape represents unprintable characters in octal overflow sequence
--block-size = SIZE scale sizes by SIZE before printing them. Eg,
`--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 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 in each column
--color [= WHEN] Controls whether to use color resolution files. WHEN can be one of
"never" (default), "always", or "auto"
-d, --directory lists the directory itself instead of the files in the directory when it encounters a directory
-D, --dired produces Emacs The result of using
-d in the dired mode is not sorted, the -aU option takes effect, the -lst option is disabled
-F, --classify plus the file type indicator (* / = @ | one of them)
--format = keyword interleaving -x, comma separated -m, horizontal -x, long -l,
single column -1, detailed -l, vertical -C
--full-time ie -l --time-style = full-iso
-g like -l , But does not list the owner
--group-directories-first
Group directories before files. This option can be used with --sort,
but once --sort = none (-U) is used, grouping is disabled
-G, --no-group in the form of a long list, without outputting group names
-h, --human -readable together with -l, output the file size in an easy-to-read format
(eg 1K
234M 2G) --si is similar to the above, but uses 1000 as the base instead of 1024
-H, --dereference-command-line
follows the command line list The symbolic link of
--dereference-command-line-symlink-to-dir
follows the symbolic link of the directory listed on the command line
--hide = PATTERN hides items that conform to the PATTERN pattern
(-a or -A will override this option)
--indicator -style = mode specifies the way to add an indicator after each project name:
none (default), classify (-F), file-type (-p)
-i, --inode display the inode number of each file
-I, --ignore = PATTERN do not display any items that match the specified shell PATTERN
-k That is --block-size = 1K
-l Use a longer format to list information
-L, --dereference When displaying the file information of the symbolic link, display
the object indicated by the symbolic link instead of the information of the symbolic link itself
-m all items Separated by commas, and fill the entire line width
-n, --numeric-uid-gid is similar to -l, but lists the UID and GID number
-N, --literal output unprocessed project name (if not specially processed Control characters)
-o is similar to -l, but does not list the information about the group
-p, --indicator-style = slash adds the symbol "/" to the directory
-q, --hide-control-chars with "?" Characters replace unprintable characters
--show-control-chars directly display characters that cannot be printed (this is the default method unless the called
program name is "ls" and the result is output in the terminal)
-Q, --quote-name Enclose the entry name in double quotation marks
--quoting-style = mode Use the specified quoting mode to display the name of the entry:
literal, locale, shell, shell-always, c, escape
-r, --reverse reverse order
-R, --recursive display subdirectories recursively
-s , --size displays the allocated size of each file in the form of blocks
-S sorts according to file size
--sort = WORD The following are the optional WORD and the corresponding options they represent:
extension -X status -c
none -U time- t
size -S atime -u
-t -u Access Time
Version use -v -u
--time = WORD display time represented by the time and WORD -l not modified when used simultaneously
between: atime, access, use, ctime or Status; plus
--sort When using the = time option, the specified time will be used as the sorting keyword
- when time -style = STYLE and -l are used at the same time, the time will be displayed according to the format represented by STYLE:
full-iso, iso, locale, posix-iso, + FORMAT.
FORMAT is the time format used by "date"; if FORMAT
is FORMAT1 <line feed> FORMAT2, FORMAT1 applies to older
files and FORMAT2 applies to newer files; if STYLE
starts with "posix-", STYLE is only available at POSIX Outside language
Take effect.
-t Sort by modification time
-T, --tabsize = width Specify the width of the tab character (Tab) instead of 8 characters
-t sort by modification time, newest first
-T, --tabsize = COLS assume tab stops at each COLS instead of 8
-u Use with -lt: sort by access time and display
use with -l: display access time and sort by file name
Other: sort by access time
-U do not sort; list by directory order Item
-v Perform natural sorting of numbers (versions) in the text
-w, --width = COLS Specify the screen width without using the current value
-x List items line by line instead of column by line
-X Sort by extension
-Z, --context print file security context
-1 only one file per line
--help display this help information and exit
--version display version information and exit
SIZE can be an optional integer, followed by one of the following units:
KB 1000, K 1024, MB 1000 * 1000, M 1024 * 1024, There are also G, T, P, E, Z, Y.
The use of color to distinguish file types has been disabled, and the default setting and --color = never both disable it.
With the --color = auto option, ls only generates color codes when standard output is connected to the terminal.
The LS_COLORS environment variable can change this setting and can be set using the dircolors command.
Exit status:
0 Normal
1 General problem (for example: unable to access subfolders)
2 Serious problem (for example: unable to use command line parameters)