Sort options. Use more mdoc macros. Some nit fixes. Bump date.

This commit is contained in:
wiz 2004-09-01 23:26:10 +00:00
parent 1575138bfb
commit d05a042013

View File

@ -1,4 +1,4 @@
.\" $NetBSD: stat.1,v 1.12 2004/09/01 22:18:20 yamt Exp $
.\" $NetBSD: stat.1,v 1.13 2004/09/01 23:26:10 wiz Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 8, 2003
.Dd September 2, 2004
.Dt STAT 1
.Os
.Sh NAME
@ -61,7 +61,7 @@ The
.Nm
utility displays information about the file pointed to by
.Ar file .
Read, write or execute permissions of the named file are not required, but
Read, write, or execute permissions of the named file are not required, but
all directories listed in the path name leading to the file must be
searchable.
If no argument is given,
@ -80,18 +80,33 @@ The information displayed is obtained by calling
with the given argument and evaluating the returned structure.
.Pp
The options are as follows:
.Bl -tag -width Ds
.Bl -tag -width XFXformatXXX
.It Fl F
As in
.Ic ls ,
display a slash (/) immediately after each pathname that is a directory, an
asterisk (*) after each that is executable, an at sign (@) after each symbolic
link, a percent sign (%) after each whiteout, an equal sign (=) after each
socket, and a vertical bar (|) after each that is a FIFO.
display a slash
.Pq Sq /
immediately after each pathname that is a directory, an
asterisk
.Pq Sq *
after each that is executable, an at sign
.Pq Sq @
after each symbolic link, a percent sign
.Pq Sq %
after each whiteout, an equal sign
.Pq Sq =
after each socket, and a vertical bar
.Pq Sq \&|
after each that is a FIFO.
The use of
.Fl F
implies
.Fl l .
.It Fl f Ar format
Display information using the specified format.
See the
.Sx FORMATS
section for a description of valid formats.
.It Fl L
Use
.Xr stat 2
@ -104,6 +119,10 @@ will refer to the target of
if file is a symbolic link, and not to
.Ar file
itself.
.It Fl l
Display output in
.Ic ls Fl lT
format.
.It Fl n
Do not force a newline to appear at the end of each piece of output.
.It Fl q
@ -115,29 +134,23 @@ fail.
When run as
.Nm readlink ,
error messages are automatically suppressed.
.It Fl f Ar format
Display information using the specified format.
See the FORMATS section
for a description of valid formats.
.It Fl l
Display output in
.Ic ls Fl lT
format.
.It Fl r
Display raw information.
That is, for all the fields in the stat-structure,
display the raw, numerical value (for example, times in seconds since the
epoch, etc.)
.It Fl s
Display information in ``shell output'', suitable for initializing variables.
.It Fl x
Display information in a more verbose way as known from some Linux
distributions.
Display information in
.Dq shell output ,
suitable for initializing variables.
.It Fl t Ar timefmt
Display timestamps using the specified format.
This format is
passed directly to
.Xr strftime 3 .
.It Fl x
Display information in a more verbose way as known from some Linux
distributions.
.El
.Ss FORMATS
Format strings are similar to
@ -164,12 +177,13 @@ Any of the following optional flags:
.It Cm #
Selects an alternate output form for octal and hexadecimal output.
Non-zero octal output will have a leading zero, and non-zero
hexadecimal output will have ``0x'' prepended to it.
hexadecimal output will have
.Dq 0x
prepended to it.
.It Cm +
Asserts that a sign indicating whether a number is positive or negative
should always be printed.
Non-negative numbers are not usually printed
with a sign.
Non-negative numbers are not usually printed with a sign.
.It Cm -
Aligns string output to the left of the field, instead of to the right.
.It Cm 0
@ -237,16 +251,14 @@ Displays the type of
.Ar file .
.It Cm Y
Insert a `` -\*[Gt] '' into the output.
Note that the default output format
for
Note that the default output format for
.Cm Y
is a string, but if specified explicitly, these four characters are
prepended.
.El
.It Cm sub
An optional sub field specifier (high, middle, low).
Only applies to
the
Only applies to the
.Cm p ,
.Cm d ,
.Cm r ,
@ -256,24 +268,37 @@ output formats.
It can be one of the following:
.Bl -tag -width Ds
.It Cm H
``High'' -- specifies the major number for devices from
.Dq High
-- specifies the major number for devices from
.Cm r
or
.Cm d ,
the ``user'' bits for permissions from the string form of
the
.Dq user
bits for permissions from the string form of
.Cm p ,
the file ``type'' bits from the numeric forms of
the file
.Dq type
bits from the numeric forms of
.Cm p ,
and the long output form of
.Cm T .
.It Cm L
``Low'' -- specifies the minor number for devices from
.Dq Low
-- specifies the minor number for devices from
.Cm r
or
.Cm d ,
the ``other'' bits for permissions from the string form of
the
.Dq other
bits for permissions from the string form of
.Cm p ,
the ``user'', ``group'', and ``other'' bits from the numeric forms of
the
.Dq user ,
.Dq group ,
and
.Dq other
bits from the numeric forms of
.Cm p ,
and the
.Ic ls -F
@ -283,15 +308,22 @@ style output character for file type when used with
.Cm L
for this is optional).
.It Cm M
``Middle'' -- specifies the ``group'' bits for permissions from the
string output form of
.Dq Middle
-- specifies the
.Dq group
bits for permissions from the string output form of
.Cm p ,
or the ``suid'', ``sgid'', and ``sticky'' bits for the numeric forms of
or the
.Dq suid ,
.Dq sgid ,
and
.Dq sticky
bits for the numeric forms of
.Cm p .
.El
.It Cm datum
A required field specifier, being one of the following:
.Bl -tag -width Ds
.Bl -tag -width 11n
.It Cm d
Device upon which
.Ar file
@ -345,7 +377,9 @@ is given.
.It Cm Y
The target of a symbolic link.
.It Cm Z
Expands to ``major,minor'' from the rdev field for character or block
Expands to
.Dq major,minor
from the rdev field for character or block
special devices and gives size output for all others.
.El
.El
@ -375,14 +409,20 @@ which default to
.Nm
exits 0 on success, and \*[Gt]0 if an error occurred.
.Sh EXAMPLES
If no options are specified, default format is
If no options are specified, the default format is
"%d %i %Sp %l %Su %Sg %r %z \\"%Sa\\" \\"%Sm\\" \\"%Sc\\" \\"%SB\\" %k %b %#Xf %N".
.Bd -literal -offset indent
\*[Gt] stat /tmp/bar
0 78852 -rw-r--r-- 1 root wheel 0 0 "Jul 8 10:26:03 2004" "Jul 8 10:26:03 2004" "Jul 8 10:28:13 2004" "Jan 1 09:00:00 1970" 16384 0 0 /tmp/bar
.Ed
.Pp
Given a symbolic link ``foo'' that points from /tmp/foo to /, you would use
Given a symbolic link
.Dq foo
that points from
.Pa /tmp/foo
to
.Pa / ,
you would use
.Nm
as follows:
.Bd -literal -offset indent
@ -464,6 +504,7 @@ The
utility appeared in
.Nx 1.6 .
.Sh AUTHORS
.An -nosplit
The
.Nm
utility was written by