Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
(SOLVED) How do I remove a symbolic link with the cli?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Fri Dec 21, 2007 7:08 pm    Post subject: (SOLVED) How do I remove a symbolic link with the cli? Reply with quote

I noticed that when I try to remove a symbolic link through the commandline (rm -Rv foo) it tries to delete the linked folder as well. What is the correct procedure to remove symbolic link with the commandline?
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered


Last edited by Kasumi_Ninja on Fri Dec 21, 2007 7:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
Naib
Advocate
Advocate


Joined: 21 May 2004
Posts: 3891
Location: UK - Birmingham

PostPosted: Fri Dec 21, 2007 7:10 pm    Post subject: Reply with quote

ensure there is no trailing "/" at the end
_________________
Quote:
Voting holds no real power, he who counts the votes has the true power.

Weaver Projects
whats the difference between 9/11 and a cow?
u stop milking a cow after 10 years
Back to top
View user's profile Send private message
jdmulloy
Tux's lil' helper
Tux's lil' helper


Joined: 24 Dec 2004
Posts: 139
Location: Massachusetts, USA

PostPosted: Fri Dec 21, 2007 7:14 pm    Post subject: Re: How do I remove a symbolic link with the commandline? Reply with quote

Aniruddha wrote:
I noticed that when I try to remove a symbolic link through the commandline (rm -Rv foo) it tries to delete the linked folder as well. What is the correct procedure to remove symbolic link with the commandline?


That's probably because you you tell it to delete thing recursively. A symbolic link is just a file so just run this
Code:
rm -v foo

Otherwise it will go through every folder it finds as well and delete it's contents then delete it.
_________________
Joe Mulloy | http://twitter.com/jdmulloy | Ron Paul in 2012! | 5-1-07 | Unban Playfool | Fire your "Too big to fail" bank http://moveyourmoney.info
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Fri Dec 21, 2007 7:34 pm    Post subject: Reply with quote

It's actually a combination of both answers :)

Code:
# rm -iv packages/
rm: cannot remove `packages/': Is a directory


Code:
# rm -iv packages
rm: remove symbolic link `packages'?


Thanks!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Fri Dec 21, 2007 9:20 pm    Post subject: Reply with quote

The -v just turns on verbose output so it says what is being deleted exactly. and -i switch is the interactive switch, it asks you "are you sure?" about everything first.
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Fri Dec 21, 2007 9:36 pm    Post subject: Reply with quote

Zepp wrote:
The -v just turns on verbose output so it says what is being deleted exactly. and -i switch is the interactive switch, it asks you "are you sure?" about everything first.


Yeah I know, I always use these :wink:
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum