Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] rmdir on directories with directories within with directories with


> > > rm -rf *
> >
> > As the old UNIX saying goes....
> >
> > 'Never use a star with rm -r'
>
> True, but possibly a little outdated. Wildcard is done by the shell, and a
> modern shell (like zsh. bash yet?) will let you see the expansion on the
> command-line before hitting return, by hitting <tab> after the wildcard
> expression.
>
> > Instead, use rm -r directoryname (eg rm -r /home/transfers).  You may
have
>
> which you are effectively doing after expanding the "*'.

Assuming you are in /home and there are no other directories than transfers
it would work - but the former can't be assumed and the latter is quite
unlikely. In this situation * is definitly not the way to go.  But given the
time of day the question was asked and answered I think I can be forgiven :)