utility

stat

GNU stat reports metadata; %s is byte size. BusyBox local build also supports -c %s. FreeBSD uses -f %z for byte size (documented, not executed).

Formal Syntax & Structure

bash syntaxbash
stat -c FORMAT FILE ...

Parameters & Attributes

NameTypeDescription
FORMATstringImplementation-specific format string.
pathstringFile or path operand; quote shell expansions.

Return Value

exit status

Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.

Working Example

Example Snippetbash
printf 'abcde' > data.txtstat -c %s data.txtbusybox stat -c %s data.txt
Bash Reference