[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do you remove files with bad/wierd names



In this specific case:

    rm -- --help

...should do the trick.  The null argument "-- " signifies to most
utilities that the remaining arguments are to be interpreted as
arguments and not options.

Other helpful hints:

 - List the file by inode, find and remove the inode:

     touch -- --help
     ls -i
     find . -inum `ls -i|grep -- '--help'|awk '{print $1}'` -exec rm {}\;

 - Most "strange" characters can be dealt with by quoting.  The above
   inode approach is a good trick to know though.

On Wed, Mar 22, 2000 at 10:14:19PM -0500, Marshal Kar-Cheung Wong wrote:
> I was wondering how to remove a file by the name of --help.tgz?
> (Don't ask...Okay if you really must know, I typed in tgz --help and I
> get that file.  There's no man page for tgz, and I think tgz shouldn't
> accept things starting with -- as file names...)  rm always takes it
> as an option, even if quotes, double-quoted, backslashed,
> regular-expressioned.  Any suggestions?
> 
> Marshal
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 

-- 
Karsten M. Self (kmself@ix.netcom.com)
    What part of "Gestalt" don't you understand?

Scope out Scoop:  http://scoop.kuro5hin.org/
Nothin' rusty about Kuro5hin:  http://www.kuro5hin.org/


Reply to: