Bash shell command

  
This article address: http://www.cnblogs.com/archimedes/p/bash-shell1.html, please indicate the source address.
lsCommand
ls is used to list the contents of the directory. It is one of the most commonly used commands for users. The format of the ls command is:
ls[options][directory name or file name]
The main parameters of the option:
.options main parameters -a, --all: Do not hide any items starting with the "ldquo.." rdquo; -A, --almost-all: Lists any items except “ . ” and “.. ”. --author: Print out each file author. -b, --escape: Indicates unprintable characters in an octal overflow sequence. --block-size=Size: The block is in the specified byte. -B, --ignore-backups: Does not list any items that end with a ~ character. -f: Do not sort, the -aU parameter takes effect, and the -lst parameter fails. -F, --classify: plus the indicator of the file type (*/=@|  One of the). -g:like -l, but do not list owner. -G, --no-group:inhibit display of group information. -i, --inode: Lists the inode number of each file. -I, --ignore=Style: Do not print any items that match the Shell Universal character. -k: ie --block-size=1K. -l: Lists information in a longer format. -L, --dereference: When the file information of the symbolic link is displayed, the object indicated by the symbolic link is displayed instead of the information of the symbolic link itself. -m: All items are separated by commas and fill the entire line width. -n, --numeric-uid-gid: Similar to -l, but lists UID and GID numbers. -N, --literal: Lists unprocessed project names, such as no special handling of control characters. -p, --file-type: plus the indicator of the file type (/=@|  One of the). -Q, --quote-name: Enclose the project name in double quotes. -r, --reverse: Arrange in reverse order. -R, --recursive: List all subdirectory layers at the same time. -s, --size: in block order.
There are several different colors when using the ls command, where blue indicates a directory, green indicates an executable file, red indicates a compressed file, light blue indicates a link file, and bold black indicates a symbolic link. gray indicates other file formats, as shown in FIG:

ls most commonly used ls -l, as illustrated in FIG:

beginning of the file type is composed of 10 characters String. The first character indicates the file type, which can be one of the following types:
- (plain file), d (directory), l (symbolic link), b (block device file), c (character device file) ). The next 9 characters indicate the access rights of the file, divided into 3 groups of 3 bits each.
The first group represents the permissions of the owner of the file, the second group represents the permissions of the same group of users, and the third group represents the permissions of other users.
The three characters of each group represent the read (r), write (w), and execute permission (x) of the file. For directories, indicates access rights. s indicates that when the file is executed, the UID or GID of the file is given to the UID (user ID) or GID (group ID) of the execution process. t indicates the setting flag (left in memory, not swapped out). If the file is a directory, files in that directory can only be deleted by the superuser, directory owner, or file owner. If it is an executable file, the pointer to its body segment remains in memory after the file is executed. When you execute it again, the system can load the file faster. The file size, build time, file or command name is then displayed.
Copyright © Windows knowledge All Rights Reserved