Files and Filesystems: Remove Files With Strange Filenames

If it is a file that is called ‘ ‘, i.e. a single space, you can delete it a couple of ways:

Also, it might actually be some kind of control character … observe:

Easy to remove with the same find . -inum technique above.

If the file starts with a - character, e.g.:

try removing it:

Obviously it’ll whinge about -foo not being an option … so:

That’ll do it. -- tells the command to stop interpreting arguments as options. You can use this technique with other commands too, e.g. mv, file, etc.