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

Re: Remove funny files



On Wed, 7 Jul 1999, Jiri Baum wrote:

> Hello,
> 
> Allan M. Wind:
> > On 1999-07-04 20:22, Rolf Edlund wrote:
> > 
> > >   rm -i Backupfiles/--exclude=files.txt
> > 
> > There are 2 tricks:
> > 
> > 	1. rm -i * (say no to everything that you want to keep)
> 
> No, this doesn't work. The shell expands the `*', and rm is once again left
> with a filename beginning with two dashes. I know, I have a lot of
> ex-umsdos directories mounted over samba.

This can actually be a very 'funny' command when you are trying to remove
files in the current directory with names like '-f' and '-r'.

NEVER use 'rm -i *' to delete a single file that has 'special' characters
in its name. If you think you need it, you are wrong.

And remember, always first use the 'ls' command instead of the 'rm'
command to test what your options will expand to. 'rm -r .*' is another
famous mistake you don't want to make. Try 'ls .*' to get an idea of what
I'm talking about.

> > 	2. rm -- FILE
> 
> That usually works, but not for all commands.

Yes, or use 'rm ./FILE', like somebody else suggested.

Remco
-- 
rd1936:  1:05am  up 27 days, 15:59,  7 users,  load average: 1.10, 1.14, 1.14


Reply to: