Commit | Line | Data |
---|---|---|
0e9d8a17 C |
1 | |
2 | ||
3 | ||
4 | LS(1) UNIX Programmer's Manual LS(1) | |
5 | ||
6 | ||
7 | ||
8 | N\bNA\bAM\bME\bE | |
9 | ls - list contents of directory | |
10 | ||
11 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS | |
12 | l\bls\bs [ -\b-1\b1A\bAa\baC\bCc\bcd\bdF\bFf\bfg\bgi\bik\bkL\bLl\blq\bqR\bRr\brs\bst\btu\bu ] [ file ... ] | |
13 | ||
14 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN | |
15 | For each directory argument, _\bl_\bs lists the contents of the | |
16 | directory; for each file argument, _\bl_\bs repeats its name and | |
17 | any other information requested. By default, the output is | |
18 | sorted alphabetically. When no argument is given, the | |
19 | current directory is listed. When several arguments are | |
20 | given, the arguments are first sorted appropriately, but | |
21 | file arguments are processed before directories and their | |
22 | contents. | |
23 | ||
24 | The options are as follows: | |
25 | ||
26 | -\b-1\b1 force one entry per line output format; this is the | |
27 | default when output is not to a terminal. | |
28 | ||
29 | -\b-A\bA List all entries except for ``.'' and ``..''. Always | |
30 | set for the super-user. | |
31 | ||
32 | -\b-a\ba List all entries; in the absence of this option, | |
33 | entries whose names begin with a period (.\b.) are _\bn_\bo_\bt | |
34 | listed. | |
35 | ||
36 | -\b-C\bC force multi-column output; this is the default when | |
37 | output is to a terminal. | |
38 | ||
39 | -\b-c\bc Use time when file status was last changed for sorting | |
40 | or printing. | |
41 | ||
42 | -\b-d\bd If argument is a directory, list only its name; often | |
43 | used with -\b-l\bl to get the status of a directory. | |
44 | ||
45 | -\b-f\bf Don't sort the output. | |
46 | ||
47 | -\b-F\bF cause directories to be marked with a trailing `/', | |
48 | sockets with a trailing `=', symbolic links with a | |
49 | trailing `@', and executable files with a trailing `*'. | |
50 | ||
51 | -\b-g\bg Include the group ownership of the file in a long out- | |
52 | put. | |
53 | ||
54 | -\b-i\bi For each file, print the i-number in the first column | |
55 | of the report. | |
56 | ||
57 | -\b-k\bk Modifies the -_\bs option, causing the sizes to be | |
58 | reported in kilobytes. | |
59 | ||
60 | ||
61 | ||
62 | ||
63 | Printed 7/27/90 1Q 1 | |
64 | ||
65 | ||
66 | ||
67 | ||
68 | ||
69 | ||
70 | LS(1) UNIX Programmer's Manual LS(1) | |
71 | ||
72 | ||
73 | ||
74 | -\b-L\bL If argument is a symbolic link, list the file or direc- | |
75 | tory the link references rather than the link itself. | |
76 | ||
77 | -\b-l\bl List in long format, giving type and mode (in the for- | |
78 | mat described by _\bs_\bt_\br_\bm_\bo_\bd_\be(3)), number of links, owner, | |
79 | size in bytes, and time of last modification for each | |
80 | file. If the file is a special file the size field | |
81 | will instead contain the major and minor device | |
82 | numbers. If the file is a symbolic link the pathname | |
83 | of the linked-to file is printed preceded by ``->''. | |
84 | ||
85 | -\b-q\bq force printing of non-graphic characters in file names | |
86 | as the character `?'; this is the default when output | |
87 | is to a terminal. | |
88 | ||
89 | -\b-R\bR recursively list subdirectories encountered. | |
90 | ||
91 | -\b-r\br Reverse the order of sort to get reverse alphabetic or | |
92 | oldest first as appropriate. | |
93 | ||
94 | -\b-s\bs Display the sizes of files and directories in 512-byte | |
95 | blocks. | |
96 | ||
97 | -\b-t\bt Sort by time modified (latest first) instead of by | |
98 | name. | |
99 | ||
100 | -\b-u\bu Use time of last access instead of last modification | |
101 | for sorting (with the -\b-t\bt option) and/or printing (with | |
102 | the -\b-l\bl option). | |
103 | ||
104 | The -_\b1, -_\bC, and -_\bl options all override each other; the last | |
105 | one specified determines the format used. | |
106 | ||
107 | The -_\bc, and -_\bu options override each other; the last one | |
108 | specified determines the file time used. | |
109 | ||
110 | When the sizes of the files in a directory are listed, a | |
111 | total count of blocks, including indirect blocks is printed. | |
112 | ||
113 | F\bFI\bIL\bLE\bES\bS | |
114 | /etc/passwd to get user id's for `ls -l'. | |
115 | /etc/group to get group id's for `ls -g'. | |
116 | ||
117 | B\bBU\bUG\bGS\bS | |
118 | The option setting based on whether the output is a teletype | |
119 | is undesirable as ``ls -s'' is much different than | |
120 | ``ls -s | lpr''. On the other hand, not doing this setting | |
121 | would make old shell scripts which used _\bl_\bs almost certain | |
122 | losers. | |
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 | Printed 7/27/90 2Q 2 | |
130 | ||
131 | ||
132 |