1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
.\" Copyright (c) 1997-1999 Michael Meskes (meskes@debian.org)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.TH STAT 1 "28 August 1997" "Linux"
.SH NAME
stat \- display file or filesystem status
.SH SYNOPSIS
.B stat
[\fI-l\fR] [\fI-f\fR] [\fI-s\fR] [\fI-v\fR] [\fI-t\fR] [\fI-c format\fR]
file-name [file-name]...
.SH DESCRIPTION
.PP
This command displays information about the specified file(s). You do
not need any access rights to the file to get this information but you
need search rights to all directories named in the path leading to the
file.
.PP
.B stat
stats the file pointed to by
.I file-name
.B stat
.I -l
is identical to
.BR stat ,
only that for links information about the files that are obtained by tracing
the links is displayed.
.B stat
.I -f
does not stat the file itself but instead stats the filesystem where
.I file-name
is located.
.B stat
.I -s
also shows security context information for SE Linux if available.
.B stat
.I -v
prints version information.
.B stat
.I -t
prints the information in terse form, suitable for parsing by other
programs
.B stat
.I -c format
displays the information in the format specified.
.SH DISPLAY
.B stat
and
.B stat
.I -l
both display the following information:
.PP
Device number
Inode number
Access rights
Number of hard links
User ID (and name if available) of owner
Group ID (and name if available) of owner
Device type (if inode device)
Total size, in bytes
Number of blocks allocated
IO block size
Time of last access
Time of last modification
Time of last change
Security Context for SE Linux if applicable
If
.I -f
is specified the following information is displayed:
.PP
Filesystem type
Block size of the filesystem
Total blocks in the filesystem
Free blocks
Free blocks for non-root user(s)
Total inodes
Free inodes
Maximum length of filenames
If
.I -c format
is specified the following interpreted sequences are available for
.I format
:
.RS
%n - File name
%N - Quoted File name with dereference if symbolic link
%d - Device number in decimal
%D - Device number in hex
%i - Inode number
%a - Access rights in octal
%A - Access rights in human readable form
%f - raw mode in hex
%F - File type
%h - Number of hard links
%u - User Id of owner
%U - User name of owner
%g - Group Id of owner
%G - Group name of owner
%t - Major device type in hex
%T - Minor device type in hex
%s - Total size, in bytes
%b - Number of blocks allocated
%o - IO block size
%S - SE Linux SID
%c - SE Linux security context
%x - Time of last access
%X - Time of last access as seconds since Epoch
%y - Time of last modification
%Y - Time of last modification as seconds since Epoch
%z - Time of last change
%Z - Time of last change as seconds since Epoch
.RE
If
.I -c format
and
.I -f
are specified the following interpreted sequences are available for
.I format
:
.RS
%n - File name
%i - File System id, __val[0] in hex
%I - File System id, __val[1] in hex
%l - Maximum length of filenames
%t - Type in hex
%T - Type in human readable form
%b - Total data blocks in file system
%f - Free blocks in file system
%a - Free blocks available to non-superuser
%s - Optimal transfer block size
%c - Total file nodes in file system
%d - Free file nodes in file system
.RE
The
.BR printf "(3)"
flag characters '#', '0', '-', ' ', and '+', as well as the field width,
and presision options can be used in
.I format.
For example, `stat -c "%010b" file' will print the number of blocks allocated
zero padded and a minimum of 10 characters wide.
.PP
.SH BUGS
None known so far.
.LP
.SH AUTHORS
Written by Michael Meskes <meskes@debian.org>,
.I -f
added from
.BR statfs
by
Radovan Garabik <garabik@melkor.dnp.fmph.uniba.sk>
.LP
.SH "SEE ALSO"
.BR stat "(2),
.BR statfs "(2)
|