delete file
May 06, 2019
Ways to delete a file starting with a dash / hyphen:
rm -- -file
The option --
means the end of options for the command.
Another option is to indicate where is the file:
rm ./-file
.
is current directory , path to -file
is ./-file
Using find:
find . -type f -exec rm {} \;
Finding the inode:
ls -li
Then using find
and the inode it can be removed with:
find . -type f -inum <inum> -delete