stat
Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 04 February 2023
Index
Return to Main Contents
NAME
stat - display stat() information of a file
SYNOPSIS
edrc/bin/stat
[
-h
]
stat
-t
stat
[
-L
]
-s stat_field
-f file
cat filelist
|
stat
[
-L
]
-s stat_field
-f -
stat
[
-L
]
-s stat_field
-f -
< filelist
AVAILABILITY
WA2L/edrc
DESCRIPTION
This command returns the file status information returned by the
stat(2)
system call.
OPTIONS
- -h
-
usage message.
- -t
-
print the CSV header of all columns as returned when invoking
-s all.
- -L
-
follow symlinks.
- -s stat_field
-
as one of the following:
-
- dev
-
device number of the filesystem where the file resides.
- ino
-
inode number of the file.
- mode
-
file mode (type and permission) as numeric representation.
- perm
-
file permission in octal representation.
- nlink
-
number of hard links to the file.
- uid
-
numeric user ID of the file owner.
- gid
-
numeric group ID of the file owner.
- rdev
-
device identifier. This only applies for
special files.
- size
-
total size of the file in bytes.
- atime
-
last access time since the epoch.
- atimel
-
last access time
in local time representation printed in military
format YYYY-MM-DD hh:mm:ss ( e.g. 2010-08-28 11:55:59 ).
- mtime
-
last modify time since the epoch.
- mtimel
-
last modify time
in local time representation printed in military
format YYYY-MM-DD hh:mm:ss ( e.g. 2010-08-28 11:55:59 ).
- ctime
-
inode change time (*not* the creation time!)
since the epoch.
- ctimel
-
inode change time (*not* the creation time!)
in local time representation printed in military
format YYYY-MM-DD hh:mm:ss ( e.g. 2010-08-28 11:55:59 ).
- blksize
-
preferred block size for file system I/O.
- blocks
-
actual number of blocks allocated.
- type
-
type of the file:
-
- f
-
File is a plain file.
- d
-
File is a directory.
- l
-
File is a symbolic link.
- p
-
File is a pipe (FIFO).
- S
-
File is a socket.
- b
-
File is a block special file.
- c
-
File is a character special file.
- t
-
File is opened by a tty.
- T
-
File is a text file.
- B
-
File is a binary file.
- all
-
print all
stat
fields including the
file
as a CSV output.
The order of the output fields is:
DEV;INO;MODE;PERM;NLINK;UID;GID;RDEV;SIZE;ATIME;MTIME;CTIME;BLKSIZE;BLOCKS;FILE;ATIMEL;MTIMEL;CTIMEL;TYPE;.
- -f file
-
filename of the file for which the stat information
should be printed. If
-
is given as
file
stdin
is read for a list of files.
ENVIRONMENT
-
EXIT STATUS
- 0
-
no error.
- 1
-
file specified is not readable.
- 2
-
operating system is not supported, yet. See
osid(3)
if you get this error.
- 4
-
usage printed.
FILES
-
EXAMPLES
-
SEE ALSO
edrcintro(1),
osid(3),
print_list(3),
select_columns(3),
sparse(3),
stat(2),
timer(1)
NOTES
-
BUGS
when using
-L
the type output is
l
and not the type of the file the symlink is pointing to.
AUTHOR
stat was developed by Christian Walther. Send suggestions
and bug reports to wa2l@users.sourceforge.net .
COPYRIGHT
Copyright © 2023
Christian Walther
This is free software; see
edrc/doc/COPYING
for copying conditions. There is ABSOLUTELY NO WARRANTY; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This document was created by man2html
using the manual pages.
Time: 16:54:31 GMT, August 28, 2024