stat
Display status of files or filesystems (POSIX, toybox)
Syntax:
stat [-Lt] [-c format] file...
Runs on:
QNX OS
Options:
- -c format
- Output specified format string instead of default.
- -L
- Follow symlinks.
- -t
- Terse (-t = -c
%n
%s
%b
%f
%u
%g
%D
%i
%h
%t
%T
%X
%Y
%Z
%o
) (with -f = -c%n
%i
%l
%t
%s
%S
%b
%f
%a
%c
%d
). See description below for formats. - file
- The pathname of the file or filesystem to display its status.
Description:
The stat utility displays the status of files or filesystems. The output can be specified using format strings.
Format strings
Format strings are introduced via the percent sign (%
).
Files have the following formats:
This sequence: | Writes: |
---|---|
%A |
Access bits (flags) |
%a |
Access bits (octal) |
%B |
Bytes per %b (512 bytes) |
%b |
Size per 512 bytes |
%C |
Security context |
%D |
Device ID (hex) |
%d |
Device ID (dec) |
%F |
File type |
%f |
All mode bits (hex) |
%G |
Group name |
%g |
Group ID |
%h |
Hard links |
%i |
Inode |
%m |
Mount point |
%N |
Long filename |
%n |
Filename |
%o |
I/O block size |
%s |
Size (bytes) |
%T |
Devtype minor (hex) |
%t |
Devtype major (hex) |
%U |
User name |
%u |
User ID |
%X |
Access Unix time |
%x |
Access time |
%Y |
Modification Unix time |
%y |
Mod time |
%Z |
Creation Unix time |
%z |
Creation time |
Filesystems have the following formats:.
This sequence: | Writes: |
---|---|
%a |
Available blocks |
%b |
Total blocks |
%c |
Total inodes |
%d |
Free inodes |
%f |
Free blocks |
%i |
File system ID |
%l |
Max filename length |
%n |
File name |
%S |
Actual block sizee |
%s |
Best transfer size |
%T |
FS type (driver name) |
%t |
FS type (hex) |
This utility is provided as part of the toybox package. For information on how to enable it, see toybox.
Contributing author:
Rob Landley and the toybox project (see https://landley.net/toybox/).
Page updated: