Thursday, April 8, 2010

How to delete a file with name beginning with hyphen?

$ rm -f -----BEGIN
rm: unrecognized option `-----BEGIN'
Try `rm --help' for more information.

Methods:
1. rm -f ./----BEGIN

2. rm -f /home/viyer/----BEGIN

3. rm -- ----BEGIN

Ref: http://unstableme.blogspot.com/2010/01/unix-delete-file-with-hyphen-at.html

No comments: