LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-19-2005, 01:38 PM   #1
Snerkel
Member
 
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262

Rep: Reputation: 30
how to remove a symlink without deleting the destination directory


hi, i have wondered this for a while and now i need to know because it is really confusing me!


i used the command ln -s but how do i delete the link without deleting the directory it is linked to? because rm or rm -f etc deletes the directory that to link is made with. i have read through many man pages but cannot find a solution.

thanks in advance, ben.
 
Old 01-19-2005, 01:43 PM   #2
y2k
Member
 
Registered: May 2004
Location: Somewhere over there!!!
Distribution: Too many to list here...
Posts: 93

Rep: Reputation: 15
Let's assuming for a second that you ran

ln -s /usr/local/bin/program /opt/program

but now you want to remove /opt/program. Well, just remove /opt/program because it will not remove /usr/local/bin/program...

y2k
 
Old 01-19-2005, 01:45 PM   #3
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
unless I'm mistaken, this should do what you want:

$ ln -s /some/where here
$ ls -l here
(whatever files you have)
$ rm here
$ ls -l /some/where
(the same files)
$ ^D
 
Old 01-20-2005, 11:47 AM   #4
Snerkel
Member
 
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262

Original Poster
Rep: Reputation: 30
cheers, i was paranoid. i didn want to delete files!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Amarok: How to remove tracks from playlist without deleting n_ransome Linux - Software 5 06-16-2009 10:07 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
symlink multiple files to new directory with new extension jmanjohn61 Linux - General 1 01-06-2005 12:55 PM
moving a symlink in a directory e1000 Linux - General 2 02-23-2004 05:09 PM
Deleting a directory... closet geek Linux - General 7 07-09-2003 06:25 AM


All times are GMT -5. The time now is 04:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration