Home > Operation and Maintenance > Linux Operation and Maintenance > How to delete inode files under Linux

How to delete inode files under Linux

WBOY
Release: 2023-05-17 21:23:45
forward
2422 people have browsed it

1. Find the inode of the file

Use stat or ls -i. The ls command with the -i parameter means to display the inode of the file.

2. Delete

find . -inum [inode number] -exec rm -i {} \.

You can test it below and create a file with special characters:

$ cd /tmp

$ touch “\Xy \ \8″

$ ls

Try to use the rm command to delete

$ rm \ Xy \ \8

Find out the inode number of this file

$ ls -il

342137 -rw-r–r– 1 tw tw 0 2008-11-20 08:57 \ Xy \ \8

342137 is the inode number you are looking for. Use the find command to delete it below

$ find . -inum 342137 -exec rm -i {} \

For example, if you have the file "2008/11/20" in your system, use rm cannot be deleted. Linux does not allow you to create this file, but it is possible under Windows, so this is where find is used in conjunction with inode.

The above is the detailed content of How to delete inode files under Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template