diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2005-04-01 16:41:42 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2005-04-01 16:41:42 +0000 |
commit | e010da13c43bbb7ac64ef171ac91922a57103784 (patch) | |
tree | d579a6e47dd4a6d036deef7f2a8a38df19ba12cb /usr.bin/stat | |
parent | 2eeedd71534573466baba4f96e92c7fc892a35dc (diff) |
cleanup;
Diffstat (limited to 'usr.bin/stat')
-rw-r--r-- | usr.bin/stat/stat.1 | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/usr.bin/stat/stat.1 b/usr.bin/stat/stat.1 index 419699a678a..8e0c57f6b9b 100644 --- a/usr.bin/stat/stat.1 +++ b/usr.bin/stat/stat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: stat.1,v 1.1 2005/04/01 07:07:31 otto Exp $ +.\" $OpenBSD: stat.1,v 1.2 2005/04/01 16:41:41 jmc Exp $ .\" $NetBSD: stat.1,v 1.11 2003/05/08 13:07:10 wiz Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -47,10 +47,7 @@ .Op Fl FLnq .Oo .Fl f Ar format | -.Fl l | -.Fl r | -.Fl s | -.Fl x +.Fl l | r | s | x .Oc .Op Fl t Ar timefmt .Op Ar @@ -62,8 +59,8 @@ 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 -all directories listed in the path name leading to the file must be +Read, write, or execute permissions of the named file are not required, but +all directories listed in the pathname leading to the file must be searchable. If no argument is given, .Nm @@ -84,7 +81,7 @@ The options are as follows: .Bl -tag -width Ds .It Fl F As in -.Ic ls , +.Xr ls 1 , 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 @@ -93,6 +90,10 @@ The use of .Fl F implies .Fl l . +.It Fl f Ar format +Display information using the specified format. +See the FORMATS section +for a description of valid formats. .It Fl L Use .Xr stat 2 @@ -105,6 +106,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 @@ -116,29 +121,21 @@ 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.) +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. .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 @@ -237,7 +234,7 @@ Displays the name of Displays the type of .Ar file . .It Cm Y -Insert a `` -\*[Gt] '' into the output. +Insert a `` -\*(Gt '' into the output. Note that the default output format for .Cm Y @@ -298,7 +295,7 @@ Device upon which .Ar file resides. .It Cm i -.Ar file Ap s +.Ar file Ns 's inode number. .It Cm p File type and permissions. @@ -307,14 +304,14 @@ Number of hard links to .Ar file . .It Cm u , g User-id and group-id of -.Ar file Ap s +.Ar file Ns 's owner. .It Cm r Device number for character and block device special files. .It Cm a , m , c The time .Ar file -was last accessed or modified, of when the inode was last changed. +was last accessed or modified, or when the inode was last changed. .It Cm z The size of .Ar file @@ -332,7 +329,7 @@ Inode generation number. .El .Pp The following four field specifiers are not drawn directly from the -data in struct stat, but are +data in struct stat, but are: .Bl -tag -width Ds .It Cm N The name of the file. @@ -371,18 +368,18 @@ and .Cm N , which default to .Cm S . -.Sh EXIT STATUS +.Pp .Nm -exits 0 on success, and \*[Gt]0 if an error occurred. +exits 0 on success, and \*(Gt0 if an error occurred. .Sh EXAMPLES Given a symbolic link ``foo'' that points from /tmp/foo to /, you would use .Nm as follows: .Bd -literal -offset indent -\*[Gt] stat -F /tmp/foo -lrwxrwxrwx 1 jschauma cs 1 Apr 24 16:37:28 2002 /tmp/foo@ -\*[Gt] / +\*(Gt stat -F /tmp/foo +lrwxrwxrwx 1 jschauma cs 1 Apr 24 16:37:28 2002 /tmp/foo@ -\*(Gt / -\*[Gt] stat -LF /tmp/foo +\*(Gt stat -LF /tmp/foo drwxr-xr-x 16 root wheel 512 Apr 19 10:57:54 2002 /tmp/foo/ .Ed .Pp @@ -390,12 +387,12 @@ To initialize some shell-variables, you could use the .Fl s flag as follows: .Bd -literal -offset indent -\*[Gt] csh +\*(Gt csh % eval set `stat -s .cshrc` % echo $st_size $st_mtimespec 1148 1015432481 -\*[Gt] sh +\*(Gt sh $ eval $(stat -s .profile) $ echo $st_size $st_mtimespec 1148 1015432481 @@ -405,16 +402,16 @@ In order to get a list of the kind of files including files pointed to if the file is a symbolic link, you could use the following format: .Bd -literal -offset indent $ stat -f "%N: %HT%SY" /tmp/* -/tmp/bar: Symbolic Link -\*[Gt] /tmp/foo +/tmp/bar: Symbolic Link -\*(Gt /tmp/foo /tmp/output25568: Regular File /tmp/blah: Directory -/tmp/foo: Symbolic Link -\*[Gt] / +/tmp/foo: Symbolic Link -\*(Gt / .Ed .Pp In order to get a list of the devices, their types and the major and minor device numbers, formatted with tabs and linebreaks, you could use the following format: -.Bd -literal -offset indent +.Bd -literal -offset 4n stat -f "Name: %N%n%tType: %HT%n%tMajor: %Hr%n%tMinor: %Lr%n%n" /dev/* [...] Name: /dev/wt8 @@ -431,14 +428,14 @@ Name: /dev/zero In order to determine the permissions set on a file separately, you could use the following format: .Bd -literal -offset indent -\*[Gt] stat -f "%Sp -\*[Gt] owner=%SHp group=%SMp other=%SLp" . -drwxr-xr-x -\*[Gt] owner=rwx group=r-x other=r-x +\*(Gt stat -f "%Sp -\*(Gt owner=%SHp group=%SMp other=%SLp" . +drwxr-xr-x -\*(Gt owner=rwx group=r-x other=r-x .Ed .Pp In order to determine the three files that have been modified most recently, you could use the following format: .Bd -literal -offset indent -\*[Gt] stat -f "%m%t%Sm %N" /tmp/* | sort -rn | head -3 | cut -f2- +\*(Gt stat -f "%m%t%Sm %N" /tmp/* | sort -rn | head -3 | cut -f2- Apr 25 11:47:00 2002 /tmp/blah Apr 25 10:36:34 2002 /tmp/bar Apr 24 16:47:35 2002 /tmp/foo @@ -460,8 +457,6 @@ utility appeared in The .Nm utility was written by -.An Andrew Brown -.Aq atatat@NetBSD.org . +.An Andrew Brown Aq atatat@NetBSD.org . This man page was written by -.An Jan Schaumann -.Aq jschauma@NetBSD.org . +.An Jan Schaumann Aq jschauma@NetBSD.org . |