ADVERTISEMENT

Linux Commands ❯ stat

stat

Display file or file system status.
syntax:

stat [OPTION]... FILE...
  • stat *
    display the status information of all the files and directories in the current directory. the information includes size, file type, access permissions, inode number and access/change/modification time stamps
  • stat my_file1
    display the staus information of my_file1 in the current directory. the information includes size, file type, access permissions, inode number and access/change/modification time stamps
  • stat my_dir1
    display the staus information of my_dir1 in the current directory. the information includes size, file type, access permissions, inode number and access/change/modification time stamps
  • stat -c %x%y%z my_file1
    display only the access time(atime), Modification time(mtime) and Change time(ctime) of my_file1.
  • stat -c %n%x%y%z *
    display the name, access time(atime), Modification time(mtime) and Change time(ctime) of all the files and directories in current directory.
  • stat -f /dev/sda
    display the file system information of first hard disk