How to Delete Ubuntu files with Special Characters

Source : SaraAdd time : Sep 16, 2010Category: Linux > Utilities

Overview: If you has puuzle about delete the files with special characters in Ubuntu, the following tutorial will help you. This article will offer you 2 methods to delete any files with special charaters or the files whose name stats with "-".

ubuntu file delete, ubuntu special characters, ubuntu guide, ubuntu 10.10, ubuntu 10.04

Software you’ll need :

Remove Ubuntu files with Sepcial Characters by Inode

If you want to delete the files with some special characters, such as dashes, slashes, the best and easiest method is to access the file by its inode.

1. Do a ls -li to get the inode of your file on Ubuntu.

2. Once had the number, run the command below to delete that file by find.
find . -inum [inode] -exec rm -i {} \;

Remove Ubuntu files with Name Starting with A "-"

If you want to remove a file whose name starts with a "-", for example "-foo", use one of these commands:

rm -- -foo
rm ./-foo

so,

$ rm -- -\,my\?\ funky.file\$name