summaryrefslogtreecommitdiff
path: root/bin/ls
diff options
context:
space:
mode:
authorJason McIntyre <jmc@cvs.openbsd.org>2005-03-24 22:53:16 +0000
committerJason McIntyre <jmc@cvs.openbsd.org>2005-03-24 22:53:16 +0000
commit14fe0a4fea0fad55085839e575370bbf9c427da6 (patch)
treea3e0cfd56aa377bb9ced094196d2076a12ddcc69 /bin/ls
parentfdd6ed5a5ae543e1968034b2cb8d4033897bbe6d (diff)
- sort options
- sync usage() - remove unnecessary quoting
Diffstat (limited to 'bin/ls')
-rw-r--r--bin/ls/ls.190
-rw-r--r--bin/ls/util.c6
2 files changed, 48 insertions, 48 deletions
diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index 20420f1fef4..41fe53bc8af 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ls.1,v 1.43 2005/01/10 15:36:17 jmc Exp $
+.\" $OpenBSD: ls.1,v 1.44 2005/03/24 22:53:15 jmc Exp $
.\" $NetBSD: ls.1,v 1.14 1995/12/05 02:44:01 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@@ -41,7 +41,7 @@
.Nd list directory contents
.Sh SYNOPSIS
.Nm ls
-.Op Fl 1ACFLRSTWacdfghiklmnopqrstux
+.Op Fl 1AaCcdFfghikLlmnopqRrSsTtuWx
.Op Ar file ...
.Sh DESCRIPTION
For each operand that names a
@@ -65,20 +65,39 @@ lexicographical order.
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl 1
+(The numeric digit
+.Dq one . )
+Force output to be one entry per line.
+This is the default when
+output is not to a terminal.
.It Fl A
List all entries except for
-.Dq \&.
+.Sq \&.
and
-.Dq \&.. .
+.Sq \&.. .
Always set for the superuser.
+.It Fl a
+Include directory entries whose names begin with a
+dot
+.Pq Sq \&. .
.It Fl C
Force multi-column output; this is the default when output is to a terminal.
+.It Fl c
+Use time file's status was last changed instead of last modification
+time for sorting
+.Pq Fl t
+or printing
+.Pq Fl l , Fl n .
+.It Fl d
+Directories are listed as plain files (not searched recursively) and
+symbolic links in the argument list are not indirected through.
.It Fl F
Display a slash
.Pq Sq /
immediately after each pathname that is a directory,
an asterisk
-.Pq Sq \&*
+.Pq Sq *
after each that is executable,
an at sign
.Pq Sq @
@@ -92,37 +111,6 @@ after each socket,
and a vertical bar
.Pq Sq \&|
after each that is a FIFO.
-.It Fl L
-If argument is a symbolic link, evaluate the file information and file type
-to be those of the file referenced by the link, and not the link itself;
-however,
-.Nm
-writes the name of the link itself and not the file referenced by the link.
-.It Fl R
-Recursively list subdirectories encountered.
-.It Fl S
-Sort by size, largest file first.
-.It Fl T
-Display complete time information for the file, including
-month, day, hour, minute, second, and year.
-This option has no effect unless one of the long format
-.Pq Fl l , Fl n
-options is also specified.
-.It Fl W
-Display whiteouts when scanning directories.
-.It Fl a
-Include directory entries whose names begin with a
-dot
-.Pq Sq \&. .
-.It Fl c
-Use time file's status was last changed instead of last modification
-time for sorting
-.Pq Fl t
-or printing
-.Pq Fl l , Fl n .
-.It Fl d
-Directories are listed as plain files (not searched recursively) and
-symbolic links in the argument list are not indirected through.
.It Fl f
Output is not sorted.
.It Fl g
@@ -131,7 +119,7 @@ Does nothing; kept for compatibility with older versions of
.It Fl h
When used with a long format
option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte,
-Petabyte and Exabyte in order to reduce the number of digits to four or fewer
+Petabyte, and Exabyte in order to reduce the number of digits to four or fewer
using powers of 2 for sizes (K=1024, M=1048576, etc.).
.It Fl i
For each file, print its inode number.
@@ -142,9 +130,15 @@ option, causing the sizes to be reported in kilobytes.
Overrides any value specified by the
.Ev BLOCKSIZE
environment variable.
+.It Fl L
+If argument is a symbolic link, evaluate the file information and file type
+to be those of the file referenced by the link, and not the link itself;
+however,
+.Nm
+writes the name of the link itself and not the file referenced by the link.
.It Fl l
(The lowercase letter
-.Dq ell. )
+.Dq ell . )
List in long format (see below).
A total sum of all file
sizes is output on a line before the long listing.
@@ -161,16 +155,20 @@ Include the file flags in a long format
output.
.It Fl p
Display a slash
-.Pq Sq \&/
+.Pq Sq /
immediately after each pathname that is a directory.
.It Fl q
Force printing of non-graphic characters in file names as
the character
.Sq \&? ;
this is the default when output is to a terminal.
+.It Fl R
+Recursively list subdirectories encountered.
.It Fl r
Reverse the order of the sort to get reverse
lexicographical order or the smallest or oldest entries first.
+.It Fl S
+Sort by size, largest file first.
.It Fl s
Display the number of file system blocks actually used by each file,
where partial units are rounded up to the next integer value.
@@ -179,6 +177,12 @@ Blocks are 512 bytes unless overridden by the
flag or
.Ev BLOCKSIZE
environment variable.
+.It Fl T
+Display complete time information for the file, including
+month, day, hour, minute, second, and year.
+This option has no effect unless one of the long format
+.Pq Fl l , Fl n
+options is also specified.
.It Fl t
Sort by time modified (most recently modified
first) before sorting the operands in lexicographical
@@ -190,14 +194,10 @@ for sorting
.Pq Fl t
or printing
.Pq Fl l , Fl n .
+.It Fl W
+Display whiteouts when scanning directories.
.It Fl x
Multi-column output sorted across the page rather than down the page.
-.It Fl \&1
-(The numeric digit
-.Dq one. )
-Force output to be one entry per line.
-This is the default when
-output is not to a terminal.
.El
.Pp
The
diff --git a/bin/ls/util.c b/bin/ls/util.c
index f99600a284b..c0cb2aca82c 100644
--- a/bin/ls/util.c
+++ b/bin/ls/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.11 2003/08/06 19:09:09 tedu Exp $ */
+/* $OpenBSD: util.c,v 1.12 2005/03/24 22:53:15 jmc Exp $ */
/* $NetBSD: util.c,v 1.12 1995/09/07 06:43:02 jtc Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)util.c 8.5 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: util.c,v 1.11 2003/08/06 19:09:09 tedu Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.12 2005/03/24 22:53:15 jmc Exp $";
#endif
#endif /* not lint */
@@ -67,7 +67,7 @@ void
usage(void)
{
(void)fprintf(stderr,
- "usage: %s [-1ACFLRSTWacdfhiklmnopqrstux] [file ...]\n",
+ "usage: %s [-1AaCcdFfghikLlmnopqRrSsTtuWx] [file ...]\n",
__progname);
exit(1);
}