Today I found there is one special file named -v in the folder.
-rw-r--r-- 1 root root 790 Apr 23 18:36 -v
In this case, we can find the file's inode number and use the inode number to delete it.
First let's find the file's inode number using ls -li.
The -i prints the inode number of each file.
ls -li
5242899 -rw-r--r-- 1 root root 790 Apr 23 18:36 -v
Then use one of below commands to delete it:
find . -inum 5242899 -delete
find . -inum 5242899 -exec rm -i {} \;
Also if we are creating multiple hard links to one file, and we want to remove that file completely- even there are still multiple hard links. We can use the same trickL:
find . -inum [inum] -delete
-rw-r--r-- 1 root root 790 Apr 23 18:36 -v
In this case, we can find the file's inode number and use the inode number to delete it.
First let's find the file's inode number using ls -li.
The -i prints the inode number of each file.
ls -li
5242899 -rw-r--r-- 1 root root 790 Apr 23 18:36 -v
Then use one of below commands to delete it:
find . -inum 5242899 -delete
find . -inum 5242899 -exec rm -i {} \;
Also if we are creating multiple hard links to one file, and we want to remove that file completely- even there are still multiple hard links. We can use the same trickL:
find . -inum [inum] -delete