aboutsummaryrefslogtreecommitdiff
path: root/man/stat.1
blob: 398b9b99876fface26c94be8605cad88c7fbbae7 (plain)
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
.\" Adapted for BNU from the GNU Coreutils 9.11 manual page; see doc/README.md.
.TH STAT "1" "2026-07-28" "BNU 9.11" "BNU Commands"
.SH NAME
stat \- display file or file system status
.SH SYNOPSIS
.B stat
[\fI\,OPTION\/\fR]... \fI\,FILE\/\fR...
.SH DESCRIPTION
.\" This page is derived from GNU Coreutils documentation.
This page documents BNU, an independent Bun implementation compatible with
GNU Coreutils 9.11.
.PP
Display file or file system status.
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#stat-L'\fB\-L, \-\-dereference\fP\X'tty: link'
follow links
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#stat-f'\fB\-f, \-\-file\-system\fP\X'tty: link'
display file system status instead of file status
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#stat--cached'\fB\-\-cached=MODE\fP\X'tty: link'
specify how to use cached attributes;
useful on remote file systems. See MODE below
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#stat-c'\fB\-c, \-\-format=\,FORMAT\fP\X'tty: link'\/\fR
use the specified FORMAT instead of the default;
output a newline after each use of FORMAT
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#stat--printf'\fB\-\-printf=FORMAT\fP\X'tty: link'
like \fB\-\-format\fR, but interpret backslash escapes,
and do not output a mandatory trailing newline;
if you want a newline, include \en in FORMAT
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#stat-t'\fB\-t, \-\-terse\fP\X'tty: link'
print the information in terse form
.TP
\X'tty: link https://www.gnu.org/software/coreutils/stat#stat--help'\fB\-\-help\fP\X'tty: link'
display this help and exit
.TP
\X'tty: link https://www.gnu.org/software/coreutils/stat#stat--version'\fB\-\-version\fP\X'tty: link'
output version information and exit
.PP
The MODE argument of \fB\-\-cached\fR can be: always, never, or default.
\&'always' will use cached attributes if available, while
\&'never' will try to synchronize with the latest attributes, and
\&'default' will leave it up to the underlying file system.
.PP
The valid format sequences for files (without \fB\-\-file\-system\fR):
.TP
%a
permission bits in octal (see '#' and '0' printf flags)
.TP
%A
permission bits and file type in human readable form
.TP
%b
number of blocks allocated (see %B)
.TP
%B
the size in bytes of each block reported by %b
.TP
%C
SELinux security context string
.TP
%d
device number in decimal (st_dev)
.TP
%D
device number in hex (st_dev)
.TP
%Hd
major device number in decimal
.TP
%Ld
minor device number in decimal
.TP
%f
raw mode in hex
.TP
%F
file type
.TP
%g
group ID of owner
.TP
%G
group name of owner
.TP
%h
number of hard links
.TP
%i
inode number
.TP
%m
mount point
.TP
%n
file name
.TP
%N
quoted file name with dereference if symbolic link
.TP
%o
optimal I/O transfer size hint
.TP
%s
total size, in bytes
.TP
%r
device type in decimal (st_rdev)
.TP
%R
device type in hex (st_rdev)
.TP
%Hr
major device type in decimal, for character/block device special files
.TP
%Lr
minor device type in decimal, for character/block device special files
.TP
%t
major device type in hex, for character/block device special files
.TP
%T
minor device type in hex, for character/block device special files
.TP
%u
user ID of owner
.TP
%U
user name of owner
.TP
%w
time of file birth, human\-readable; \- if unknown
.TP
%W
time of file birth, seconds since Epoch; 0 if unknown
.TP
%x
time of last access, human\-readable
.TP
%X
time of last access, seconds since Epoch
.TP
%y
time of last data modification, human\-readable
.TP
%Y
time of last data modification, seconds since Epoch
.TP
%z
time of last status change, human\-readable
.TP
%Z
time of last status change, seconds since Epoch
.PP
Valid format sequences for file systems:
.TP
%a
free blocks available to non\-superuser
.TP
%b
total data blocks in file system
.TP
%c
total file nodes in file system
.TP
%d
free file nodes in file system
.TP
%f
free blocks in file system
.TP
%i
file system ID in hex
.TP
%l
maximum length of filenames
.TP
%n
file name
.TP
%s
block size (for faster transfers)
.TP
%S
fundamental block size (for block counts)
.TP
%t
file system type in hex
.TP
%T
file system type in human readable form
.SS "--terse is equivalent to the following FORMAT:"
.IP
%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o %C
.SS "--terse --file-system is equivalent to the following FORMAT:"
.IP
%n %i %l %t %s %S %b %f %a %c %d
.PP
Your shell may have its own version of stat, which usually supersedes
the version described here.  Please refer to your shell's documentation
for details about the options it supports.
.SH AUTHORS
Upstream GNU Coreutils documentation authors:
Written by Michael Meskes.
.br
Adapted for BNU; the BNU implementation is independent.
.SH "REPORTING BUGS"
Report BNU bugs at <https://github.com/Soccera1/bnu/issues>.
.br
For upstream GNU Coreutils, see <https://www.gnu.org/software/coreutils/>.
.SH COPYRIGHT
Copyright \(co 2026 Free Software Foundation, Inc.
.br
This manual page was adapted for BNU in 2026.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
\fBstat\fP(2), \fBstatfs\fP(2), \fBstatx\fP(2)
.PP
.br
Upstream documentation <https://www.gnu.org/software/coreutils/stat>
.br
BNU documentation is available locally via: info \(aq(bnu) stat invocation\(aq