Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
Goeduhub's Online Courses @ Udemy in Just INR 570/-
Online Training - Youtube Live Class Link
0 like 0 dislike
814 views
in RTU/BTU B.Tech (CSE-IV Sem) Linux Programming Lab by Goeduhub's Expert (7.6k points)
edited by
Commands related to inode in Linux

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 360/- || For International Students- $9.99/-

S.No.

Course Name

 Coupon

1.

Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence

Apply Coupon

2.

Natural Language Processing-NLP with Deep Learning in Python Apply Coupon

3.

Computer Vision OpenCV Python | YOLO| Deep Learning in Colab Apply Coupon
    More Courses

1 Answer

1 like 0 dislike
by Goeduhub's Expert (7.6k points)
 
Best answer

Commands related to inode in Linux

Inode number : Inode number also called index number .An Inode number points to an Inode. An Inode is a data structure that stores the following information about a file :

  • Size of file
  • Device ID
  • User ID of the file
  • Group ID of the file
  • The file mode information and access privileges for owner, group and others
  • File protection flags
  • The timestamps for file creation, modification etc
  • link counter to determine the number of hard links
  • Pointers to the blocks storing file’s contents

Check Inodes on Filesystem

You can find a total number of inodes on disk by using ‘-i‘ option with df command 

Output :  

Find Inode number of File: To check inode number of file use following command. The first field in output is an inode number of the file.

ls -il filename

Output : 

Inode Changes with Copy, Move and Delete :

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

Output : 

cp v.txt v_.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.

Output : 

mv filename path_where_you_want_to_copy

mv v.txt /home/cloudera 

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

Output : 

Commands to access Inode numbers

1) Ls -i Command :the flag -i is used to print the Inode number for each file.

2) Df -i Command: df -i command displays the inode information of the file system.

3) Stat Command:Stat command is used to display file statistics that also displays inode number of a file.

Output : 

ls -i 

df -i

stat a.txt


For more Rajasthan Technical University CSE-IV Sem Linux Programming Lab Experiments Click Here


3.3k questions

7.1k answers

394 comments

4.6k users

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 
...