First, we will create a file with special character as well as spaces in it’s name:
touch "$this is %a +bad -example"

Let’s check the created file and it’s ownership information:
ls -l

From the ownership information, it is clear that I have rights to delete this file, now we try to delete this file:
rm is %a +bad -example

Note: You can if you add the before the name, but you’d have to guess as a user that it was used in the file creation.
To delete this file, we need to know it’s inode number by using this command:
ls -il

Then use the find command to delete the file by it’s inode:
find . -inum 270016 -exec rm -i {} ;

Hope this will help you!
No comments:
Post a Comment