To obtain information about a file:
$ stat file
To obtain information about the filesystem file is on:
$ stat -f file
Use the -c option and various format sequences to obtain tailored output or the -t format for terse (and easily parsed) output. See the stat man page for full details.
Find out the size
- df - Report disk usage by filesystems.
- du - Report disk usage by directory
- sync - Update all cached disk blocks.
- truncate - Change file length