delete ~ directory

Alexander Dalloz alexander.dalloz at uni-bielefeld.de
Mon Apr 19 14:52:23 UTC 2004


Am Mo, den 19.04.2004 schrieb Vano Beridze um 09:17:

> Hello
> 
> I've accidentally (from a java program) created a directory named ~ in
> my home directory.
> Because ~ is a synonim for a home directory how can I delete this 
> directory safely?
> I mean I don't want to delete my whole home directory just that wierd
one.
> 
> Thank you
> Vano

Besides the other suggestions, as a general annotation too, on bash you
can use

command -- special_sign_name

The leading "--" tells the shell that the following is no options set.
So in your case it would be while you are in the directory where the
miscreated directory is placed

rm -rf -- ~

You can use this too if you accidentally created i.e. a file named "-f" 

rm -f    will not work, but
rm -- -f will do.

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 1 (Yarrow) on Athlon CPU kernel 2.4.22-1.2179.nptl
Sirendipity 16:51:48 up 23:37, 10 users, 0.05, 0.15, 0.16 
                   [ Γνωθι σ'αυτον - gnothi seauton ]
             my life is a planetarium - and you are the stars





More information about the fedora-list mailing list