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

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


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

PostPosted: Fri Dec 21, 2007 2: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?
_________________
Help Gentoo improve, do some bug wrangling!


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


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

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

ensure there is no trailing "/" at the end
_________________
Quote:
There is a forgotten, nay almost forbidden word, which means more to me than any other. That word is ENGLAND

Weaver Projects
Back to top
View user's profile Send private message
jdmulloy
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2004
Posts: 137
Location: Massachusetts, USA

PostPosted: Fri Dec 21, 2007 2: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

Ron Paul in 2012!

5-1-07
Unban Playfool

Gnome Sucks! Use KDE 4.2
Vista: It's like a lobotomy, for your computer.
Back to top
View user's profile Send private message
Aniruddha
Veteran
Veteran


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

PostPosted: Fri Dec 21, 2007 2: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!
_________________
Help Gentoo improve, do some bug wrangling!
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


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

PostPosted: Fri Dec 21, 2007 4: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
Aniruddha
Veteran
Veteran


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

PostPosted: Fri Dec 21, 2007 4: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:
_________________
Help Gentoo improve, do some bug wrangling!
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 - 5 Hours
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