Saturday, December 4, 2010

How to remove files starting with - minus in the filename

There might be several ways to remove files starting with first character as - minus. But i am providing 3 solutions below.

1. $ rm ./-filename

2. $ rm -- -filename

3. Find the inode number by using ls -i and then use the below command
find . -inum 45678 -exec rm {} \;

1 comment:

ERP said...

wonderful information, I had come to know about your blog from my friend nandu , hyderaba.
i have read atleast 7 posts of yours by now, and let me tell you, your website gives the
best and the most interesting information. This is just the kind of information that i had
been looking for, i'm already your rss reader now and i would regularly watch out for the new posts

Oracle Fusion HCM Training