Using unlink to delete files

Encountered a problem deleting a file with the name "--option=backup" (without the quotes). Don't ask me how it got there, I have no idea. It can't be deleted using rm or renamed using mv.


[user@system /]# rm '--owner=backup'
rm: unrecognized option `--owner=backup'
Try `rm --help' for more information.
[user@system /]# mv '--owner=backup' nothing
mv: unrecognized option `--owner=backup'
Try `mv --help' for more information.

Solution? Shyam Mani suggested unlink '--option=backup'. Apparently, it directly uses the Linux unlink system call to delete files, so does not encounter the same problem as rm
Update 1: Some people suggested alternatives like rm -- '--option=backup', or rm ./--option=backup. Both worked nicely.
Update 2: And yes, Konqueror can delete that file too. Why didn't I think of that? Sticking out tongue

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <img> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

Smileys

Smileys
SmileyAcronyms
=)=) :) :-) :smile:
;);) ;-) :wink:
=(=( :( :-( :sad:
=D=D :D :-D :lol:
}:)}:) }:-) :evil:
=p=p =P :P :-P :tongue:
O.oO.o :O :-O :shocked:
:?:? :-? :puzzled:
8)8) 8-) :cool:
:jawdrop::jawdrop:
:sick::sick: :barf: