• Home
  • Ubuntu 16.04
    • Whats New ?
    • Install JAVA 8
    • Setup LAMP Stack
    • Install LEMP Stack
    • Install Node.js
    • Install Git
    • Move Unity Launcher to Bottom
  • FeedBack
  • Funny Tools
  • Tutorials
    • Linux Distributions
      • CentOS
      • Debian
      • Fedora
      • LinuxMint
    • Monitoring Tools
      • Monit
      • Nagios
      • NRPE
    • Network Services
      • DHCP
      • DNS
      • FTP
    • Databases
      • MySQL
      • MariaDB
      • MongoDB
      • PostgreSQL
      • SQL Server
    • Amazon Web Services
  • Submit Article
  • About Us
TecAdmin.net
  • Home
  • Ubuntu 16.04
    • Whats New ?
    • Install JAVA 8
    • Setup LAMP Stack
    • Install LEMP Stack
    • Install Node.js
    • Install Git
    • Move Unity Launcher to Bottom
  • FeedBack
  • Funny Tools
  • Tutorials
    • Linux Distributions
      • CentOS
      • Debian
      • Fedora
      • LinuxMint
    • Monitoring Tools
      • Monit
      • Nagios
      • NRPE
    • Network Services
      • DHCP
      • DNS
      • FTP
    • Databases
      • MySQL
      • MariaDB
      • MongoDB
      • PostgreSQL
      • SQL Server
    • Amazon Web Services
  • Submit Article
  • About Us
12 March 2013

What is inode number in Linux ?

Written by Rahul K. | March 12, 2013
Uncategorized inode, inode number, inode table

An inode is an entry in inode table, containing information ( the metadata ) about a regular file and directory. An inode is a data structure on a traditional Unix-style file system such as ext3 or ext4.

Inode number also called as index number , it consists following attributes.

File types ( executable, block special etc )
Permissions ( read, write etc )
UID ( Owner )
GID ( Group )
FileSize
Time stamps including last access, last modification and last inode number change.
File deletion time
Number of links ( soft/hard )
Location of ile on harddisk.
Some other metadata about file.

To check inode number of file use following command, first field in ouput is an inode number.

# ls -il  tecadmin.txt
1150561 -rw-r--r-- 1 root root 0 Mar 10 01:06 tecadmin.txt

Search file on basis of inode number.

# find /root -inum 1150561
/root/tecadmin.txt
What happen with inode when copy, move or delete a file:

Copy file: cp allocates a free inode number and placing a new entry in inode table.

# ls -il  tecadmin.txt
1150561 -rw-r--r-- 1 root root 0 Mar 10 01:06 tecadmin.txt
# cp tecadmin.txt tecadmin.net.txt
# ls -il tecadmin.net.txt
1150562 -rw-r--r-- 1 root root 0 Mar 10 01:09 tecadmin.net.txt

Move or Rename a file: if destination is same filesystem as the source, Has no impact on inode number, it only changes the time stamps in inode table.

# ls -il  tecadmin.txt
1150561 -rw-r--r-- 1 root root 0 Mar 10 01:06 tecadmin.txt
# mv tecadmin.txt /opt/
# ls -il /opt/tecadmin.txt
1150561 -rw-r--r-- 1 root root 0 Mar 10 01:06 /opt/tecadmin.txt

Delete a file: Deleting a file in linux decrements the link count and freeing the inode bumber to be reused.

Share it!
Share on Facebook
Share on Twitter
Share on Google+
Share on Reddit
Share on Tumblr
Rahul K.
Rahul K.
Connect on Facebook Connect on Twitter Connect on Google+

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

6 Comments

  1. Santosh Das Reply to Santosh
    February 14, 2018 at 10:11 am

    Thanks! very nicely explained

  2. n s n srinivas Reply to n
    January 20, 2018 at 5:19 am

    Good and Quick explanation….

  3. 3nokor.com Reply to 3nokor.com
    December 12, 2017 at 7:37 am

    awesome explain. Thanks

  4. bhargav Reply to bhargav
    September 16, 2017 at 11:49 am

    That was great … u can be a good mentor

  5. sandeep Reply to sandeep
    December 17, 2014 at 6:53 pm

    thanks to explain keep it up.

  6. Adnan Reply to Adnan
    August 7, 2014 at 12:38 pm

    Quite helpful. Very well explained. thnx

Leave a Reply

Cancel reply

Popular Posts

  • How to Install JAVA 8 on Ubuntu 16.04/14.04, LinuxMint 18/17
  • How to Install s3cmd in Linux and Manage Amazon s3 Buckets
  • How to Install AnyDesk on Ubuntu, Debian and LinuxMint (Alternative of TeamViewer)
  • How to Setup Selenium with ChromeDriver on Ubuntu 16.04
  • How to Install MySQL on macOS Sierra and High Sierra
All rights reserved. © 2013-2018 TecAdmin.net. This site uses cookies. By using this website you agree our term and services