Linux / UNIX: Display file inode (index number)
Q. How do I display file inode number using command line?
A. An inode is a data structure on a Unix / Linux file system. An inode stores basic information about a regular file, directory, or other file system object. You can use following two commands to display an inode:
[a] ls command : list directory contents
[b] stat command : display file or file system status
ls command
Type ls command with -i ( print the index number of each file ) option:
$ ls -i /etc/passwd
Output:
752010 /etc/passwd
752010 is index number (inode) for /etc/passwd file.
stat command
$ stat /etc/passwd
Output:
File: `/etc/passwd'
Size: 2026 Blocks: 8 IO Block: 4096 regular file
Device: 811h/2065d Inode: 752010 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2007-08-20 23:19:20.000000000 +0530
Modify: 2007-07-07 00:06:56.000000000 +0530
Change: 2007-07-07 00:06:56.000000000 +0530
You can use inode number to delete or search a file.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- How to: Find the inode size of an ext2 / ext3 filesystem
- How do I find out more information about ext3 or ext2 file system?
- Why is it possible to create symbolic links across file system boundaries?
- How to: Formatting Linux Filesystem
- Find the file permission without using ls -l command
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: data_structure, index_number, inode_number, linux_file_system, ls_command, stat_command



Recent Comments
Today ~ 1 Comment
Today ~ 3 Comments
Today ~ 57 Comments
Yesterday ~ 9 Comments
Yesterday ~ 7 Comments