Use stat command to view file statistics

Moderators: ashishsinha, alok, Linux Moderators

Use stat command to view file statistics

Postby alok on Wed Mar 21, 2012 12:18 pm

You know you have a "stat" command, that can be used either to check the status or properties of a single file or a entire filesystem.

It displays file or file system status such as:

File size
File type
Inode number
UID/GID
File access , modify and creation time etc.

For checking the status of a file, use

Code: Select all
stat /your/filename


For checking the status of a entire filesystem, use

Code: Select all
stat -f /home


Its a very handy tool for checking the information about last access dates etc. of a filesystem or a file.

Below is the screenshoot from my machine.
networknuts-stat-command.png
stats command usage
User avatar
alok
 
Posts: 237
Joined: Tue Dec 23, 2008 11:11 am

Return to Linux Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron