Monday, September 3, 2007

display file and file system status

Display of file or file system status

Linux is totally comprised of different file types. Here's an entry on display more file info or file system info status using the linux command stat.

# stat /dev/sda1
# stat /dev/cdrom
# stat testfile.txt
# stat program.rpm
# stat test.iso

A sample output of issuing stat to test.iso
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File: `test.iso'
Size: 360448 Blocks: 712 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 4325435 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 500/ ver) Gid: ( 500/ ver)
Access: 2007-09-03 06:27:13.000000000 +0100
Modify: 2007-07-29 03:40:54.000000000 +0100
Change: 2007-09-02 12:14:12.000000000 +0100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Determine status info of a partition
# stat /dev/sda1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File: "/dev/sda1"
ID: 0 Namelen: 255 Type: tmpfs
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 63395 Free: 63386 Available: 63386
Inodes: Total: 63395 Free: 62934
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From the given result, you can acquire more information on the queried object such as fundamental block size, file system type, Inodes, IO block types, file blocks covered, permissions and modes, user (UIDs) and group (GUIDs) ownerships and more.

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy