Stat – Displays the detailed status of a particular file or a file system.
Syntax – stat [OPTION]… FILE…
-f, –filesystem display filesystem status instead of file status
-c, –format=FORMAT use the specified FORMAT instead of the default
-L, –dereference follow links
-Z, –context print the SELinux security context
-t, –terse print the information in terse form
–help display this help and exit
–version output version information and exit
stat -f /dev/sda
With the -f option, stat can return the status of an entire file system. Here, it returns the status of the first hard disk.
stat –format “%A” /var/log/syslog
Display only the access restrictions, in human-readable form, of the system log /var/log/syslog. Output will resemble the following:
…which indicates that the file is readable and writable by root, readable by the owning group (in this case the admin group), and not accessible at all by others.