Per Liden per at
Mon Jun 12 03:42:51 PDT 2000

On Mon, 12 Jun 2000, Claudio Nieder wrote:

> Hi,
> >     you might want to do ``/bin/rm -rf /tmp/* /tmp/.*''.  (X and certain
> > other programs make dotfiles in /tmp.)
> !!!!!!   D E A D L Y   W R O N G   !!!!!!
> But experiance for yourself if you dare. I did once, though only with 
> a subdirectory of my home dir.
> /tmp/.* matches also ..
> Thus you are /bin/rm -rf /tmp/..
> Which s equivalent to /bin/rm -rf /


. and .. is NOT accepted by rm as the last path component of a file. 
Thus, rm -rf /tmp/.* is safe and will not delete /tmp/.. (ie. /).

----- from man page ------ 
It is an error when the last path component of file is either . or ..  
(so as to avoid unpleasant surprises with 'rm -r .*' or so). 
------ end ------

Try it yourself, typing "rm -rf .." gives you
rm: cannot remove `.' or `..'


Per Liden  <per at>  <>

Mail archive:
IRC access: server: port: 6667 channel: #LFS
News Reader access:
Unsubscribe: email lfs-discuss-request at and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)

More information about the lfs-dev mailing list