[NTLUG:Discuss] remove file

Steve Baker sjbaker1 at airmail.net
Wed Apr 20 09:46:15 CDT 2005


To add to what others have already said:  The fun and games really
start when the garbage filename starts with a '-' because then 'rm'
thinks the filename is a commandline option.

The simplest thing in that case (and in most other cases of crazily
screwed up filenames actually) is to use a GUI-based tool like
midnight commander ('mc') to delete it.

However, if you really want to do it with a command line tool:

     rm -- -whatever

...will remove a file called '-whatever' without saying:

     rm: invalid option -- w

...as it usually would.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----




More information about the Discuss mailing list