Linux uses inode (i node number) to delete the file

Linux knowledge learning experience today, think of the next line before AWD offensive and defensive game when the dead horse, record it

In Linux inside, sometimes we encounter weird file name, so we can not be deleted, for example, we created a "hello world" file called, because the middle to add a space, so if we deleted use

rm hello world

  Error occurs

Of course, we can use

rm "hello world"

  But in fact there are a lot of weird file name

File so we can use the i-node to remove the strange file name

First, let's list the files in the current directory node i

ls -i

  

 

 

 You can see the file appears in front of the i-node, delete "hello world" file here

I is its node 391,866

So we find the i-node simultaneously delete operation

 

 

find . -inum 391866 -exec rm {} \;

  You can see the files have been deleted

By analogy, the same method can also delete the file name that was particularly strange Trojan

Guess you like

Origin www.cnblogs.com/Cl0ud/p/12210707.html