Jun 162011

sudoThe stat command is really useful to gather information from file, directory and file system.
The basic usage of stat is:

~#stat /etc/passwd
File: `/etc/passwd'
Size: 999       	Blocks: 8          IO Block: 4096   regular file
Device: ca00h/51712d	Inode: 845         Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2011-05-26 12:14:41.000000000 +0200
Modify: 2011-05-26 12:14:41.000000000 +0200
Change: 2011-05-26 12:14:41.000000000 +0200

So, without options you can have the following information

File : Size in Bytes
Blocks : Number of blocks used
IO Block : Size in bytes of every block.
Device : The identifier number of your storage device (harddrive, etc.)
Inode : The inode number that the file or directory is linked to.
Access/Modify and change Times : Note that the timestamps also include which time zone that accesses or modifications took place in. in this example +0200 Continue reading »

flattr this!