Delete a Symbolic Link?
- From: "Ditch Brodie" <dbrodie@xxxxxxx>
- Date: Fri, 10 Mar 2006 18:01:38 -0500
I have encountered this problem a couple of times and need to know what it
is that I'm doing wrong. I often create a symbolic link in my /html folder
to link to the docs for FreeBSD or other important stuff. When I need to
erase this link and I execute the rm -r ./name_of_link it not only erases
the link, it erases the file or directory of files the link pointed to. This
is not what the manpage on rm says is supposed to happen.
Many of you won't believe me on this so here is the printout of the screen
that I captured while doing this. You can see that in the /usr/local/pgsql
directory there was a directory called doc and I linked to it in my /html
directory. First I tried to be safe and just used rm without the -r switch.
When that did not work, I used the -r switch and poof, the
/usr/local/pgsql/doc directory vanished along with the link.
localhost# ll /usr/local/pgsql/
total 12
drwxr-xr-x 2 root wheel 512 Oct 19 13:28 bin
drwxr-xr-x 3 root wheel 512 Oct 19 13:28 doc
drwxr-xr-x 6 root wheel 512 Oct 19 13:28 include
drwxr-xr-x 3 root wheel 1536 Oct 19 13:28 lib
drwxr-xr-x 4 root wheel 512 Oct 19 13:26 man
drwx------ 8 postgres postgres 512 Mar 7 19:53 pgdata
drwxr-xr-x 3 root wheel 512 Oct 19 13:28 share
localhost# ll
total 4
lrwxr-xr-x 1 root wheel 20 Oct 19 14:33 PostgreSQL-8.0.4 ->
/usr/local/pgsql/doc
lrwxr-xr-x 1 root wheel 37 Jan 31 16:11 Samba-3.0.21b ->
/usr/src/samba-3.0.21b/docs/htmldocs/
drwxr-xr-x 5 root wheel 512 Mar 10 13:16 myfolder
drwxr-xr-x 2 root wheel 512 Mar 3 16:55 morestuff
localhost# rm PostgreSQL-8.0.4/
rm: PostgreSQL-8.0.4/: is a directory
localhost# rm -r PostgreSQL-8.0.4/
localhost# ll /usr/local/pgsql/
total 12
drwxr-xr-x 2 root wheel 512 Oct 19 13:28 bin
drwxr-xr-x 6 root wheel 512 Oct 19 13:28 include
drwxr-xr-x 3 root wheel 1536 Oct 19 13:28 lib
drwxr-xr-x 4 root wheel 512 Oct 19 13:26 man
drwx------ 8 postgres postgres 512 Mar 7 19:53 pgdata
drwxr-xr-x 3 root wheel 512 Oct 19 13:28 share
The manpage for rm says this command is only supposed to erase the link not
the object the link points to. What am I doing wrong here?
.
- Follow-Ups:
- Re: Delete a Symbolic Link?
- From: F. Senault
- Re: Delete a Symbolic Link?
- From: Steve O'Hara-Smith
- Re: Delete a Symbolic Link?
- Prev by Date: Re: Upgrading while libraries/programs in use
- Next by Date: Re: Delete a Symbolic Link?
- Previous by thread: databases/firebird-server problem
- Next by thread: Re: Delete a Symbolic Link?
- Index(es):
Relevant Pages
|