Commit | Line | Data |
---|---|---|
8c95d292 BJ |
1 | .TH LS UCB 2/24/79 UCB |
2 | .SH NAME | |
3 | ls \- list contents of directory | |
4 | .SH SYNOPSIS | |
5 | .B ls | |
6 | [ | |
7 | options | |
8 | ] name ... | |
9 | .SH DESCRIPTION | |
10 | .IR Ls (UCB) | |
11 | is similar to | |
12 | .IR ls (1) | |
13 | but has three possible listing formats. | |
14 | The format chosen depends on whether the output is going | |
15 | to a teletype, and may also be controlled by option flags. | |
16 | The default format for a teletype is to list the contents of directories | |
17 | in multi-column format, with the entries sorted down the columns. | |
18 | (See also the | |
19 | .B \-x | |
20 | option below.) | |
21 | If the standard output is not a teletype, the default format is to | |
22 | list one entry per line. | |
23 | This is the way | |
24 | .IR ls (1) | |
25 | always works. | |
26 | Finally, there is a stream output format in which files are listed | |
27 | across the page, separated by `,' characters. | |
28 | The | |
29 | .B \-m | |
30 | flag enables this format. | |
31 | .PP | |
32 | .B "Note:" | |
33 | Files which are not the contents of a directory being interpreted | |
34 | are always sorted across the page rather than down the page in columns. | |
35 | This is because the individual file names may be arbitrarily long. | |
36 | .PP | |
37 | New options are: | |
38 | .TP 4 | |
39 | .B \-m | |
40 | force stream output format | |
41 | .TP 4 | |
42 | .B \-1 | |
43 | force one entry per line output format, e.g. to a teletype | |
44 | .TP 4 | |
45 | .B \-c | |
46 | force multi-column output, e.g. to a file or a pipe | |
47 | .TP 4 | |
48 | .B \-q | |
49 | force printing of non-graphic characters in file names as | |
50 | the character `?'; this normally happens only if the output device is | |
51 | a teletype | |
52 | .TP 4 | |
53 | .B \-x | |
54 | force columnar printing to be sorted across rather than | |
55 | down the page; | |
56 | this is the default if the last character of the name the program is invoked | |
57 | with is not an `l' or an `s'. | |
58 | .SH SEE ALSO | |
59 | ls(1), l(UCB) | |
60 | .SH FILES | |
61 | /etc/passwd to get user ID's for | |
62 | .BR "ls \-l" "." | |
63 | .SH BUGS | |
64 | Newline and tab are considered printing characters in file names. | |
65 | .PP | |
66 | Output device is assumed to be 80 columns wide. | |
67 | Columns are basically 15 characters wide, 20 characters wide if | |
68 | .BR \-i " or " "\-s\fR is specified, 25 characters wide if both" | |
69 | .BR \-i " and " "\-s\fR are specified." | |
70 | In any case where | |
71 | .BR \-l "" | |
72 | or | |
73 | .BR \-n "" | |
74 | is specified, we assume | |
75 | only one entry will fit per line. | |
76 | .PP | |
77 | The option setting based on whether the output is a teletype is | |
78 | undesirable as: | |
79 | .PP | |
80 | .DT | |
81 | ls \-s | lpr | |
82 | .PP | |
83 | is much different than | |
84 | .PP | |
85 | ls \-s | |
86 | .PP | |
87 | On the other hand, not doing this setting would make old shell scripts | |
88 | which used | |
89 | .I ls | |
90 | almost certain losers, | |
91 | and then one could no longer do, e.g.: | |
92 | .PP | |
93 | ls \-s | sort \-nr | |
94 | .PP | |
95 | but would have to do | |
96 | .PP | |
97 | ls \-s \-1 | sort \-nr | |
98 | .PP | |
99 | Column widths choices are poor for terminals which can tab. |