Information Technology Reference
In-Depth Information
Table 4.2
Command-Line Arguments for the ls Command (continued)
Argument
Description
-i
Lists i-node.
-l
Lists file permissions, ACL indication, number of links, owner, group,
byte size, and last modification timestamp.
-L
For symbolic links, lists referenced directory/file instead of the link.
-m
Lists information across the page, separated by columns.
-n
Lists file permissions, ACL indication, number of links, UID of owner,
GID of group, byte size, and last modification timestamp. Same as -l
except UID and GID are listed instead of owner and group.
-o
Lists file permissions, ACL indication, number of links, owner, byte size,
and last modification timestamp. Same as -l except does not list group.
-p
Marks directories with a trailing forward slash ( / ).
-q
Uses the question mark ( ? ) for any non-printing characters in directo-
ry/filenames.
-r
Reverses the order of sort (zyx…instead of abc…or oldest instead of
newest).
-R
Recursively lists contents of subdirectories.
-s
Lists size in blocks (including indirect blocks).
-t
Sorts by modification time instead of alphabetically by directory/file.
When combined with -u , sorts by access time and when combined with
-c , sorts by i-node modification time.
-u
Uses last access time for sorting and displaying.
-x
Multi-column display sorted across the page instead of down the page.
-1
Displays one directory/file per line.
The ls command supports a wide variety of command-line arguments to dis-
play and sort almost everything you would want to know about directories
and files.
The more important command-line options are -a , -d , -F , -l , -r , -R , -t and -1 . Be cer-
tain to understand the effect of these command-line arguments on the information
displayed by the ls command.
When using one of the long listing formats of the ls command ( -g , -l , -n ,
or -o ), the file permissions and additional information are displayed in the
first 11 characters of each directory/file entry displayed. Table 4.3 lists the
characters used in the first character of this file permission field.
Search WWH ::




Custom Search