Thursday, March 24, 2011

Inodes Linux /Unix


=> File type (executable, block special etc)
=> Permissions (read, write etc)
=> Owner
=> Group
=> File Size
=> File access, change and modification time (remember UNIX or Linux never stores file creation time, this is favorite question asked in UNIX/Linux sys admin job interview)
=> File deletion time
=> Number of links (soft/hard)
=> Extended attribute such as append only or no one can delete file including root user (immutability)
=> Access Control List (ACLs)
Each inode is identified by a unique inode number within the file system. Inode is also know as index number.

How do I see file inode number?

[root@rajat Desktop]# stat Amazon\ Web\ Services.pdf 
  File: `Amazon Web Services.pdf'
  Size: 1968423   Blocks: 3848       IO Block: 4096   regular file
Device: 803h/2051d Inode: 262327      Links: 1
Access: (0644/-rw-r--r--)  Uid: (  500/   rajat)   Gid: (  500/   rajat)
Access: 2011-03-25 10:22:30.192428487 +0530
Modify: 2010-06-01 00:34:44.000000000 +0530
Change: 2011-03-21 23:20:08.933990061 +0530

[root@rajat Desktop]#ls -i Amazon\ Web\ Services.pdf 
262327 Amazon Web Services.pdf 





No comments: