How to remove a file using inode number
This post will help you to know how to delete a file using inode number.
What is Inode?
An inode is an internal data structure that Linux uses to store information about a filesystem object. Each file/directory on a Linux system has an inode and is identified by an inode number, hence the inode count is the total number of files/directories on the server. Inodes provide important information of a file such as user, group ownership, access mode and type.
You can use the following command to list the inode number of files located in present working directory.
ls -il
Please run the following command if you would like to know about the inode of a particular file.
ls -i <file_name>
Then execute the following command to remove a file using inode number.
find . -inum [inode-number] -exec rm -i {} \;
That’s it!
If you like this post and wish to receive more articles from us, please like our FB page: Grepitout
Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.
For more details on our services, please drop us an E-mail at info@grepitout.com
Add Comment