file-test
Bash -s file test
True if file size is greater than zero.
Formal Syntax & Structure
bash syntaxbash
[ -s path ]Return Value
exit status
True if file size is greater than zero.
Working Example
Example Snippetbash
: > empty.txt[ -s 'empty.txt' ]printf '%s\n' "$?"