LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-01-2014, 05:01 PM   #1
bibiki
LQ Newbie
 
Registered: Jul 2010
Posts: 19

Rep: Reputation: 0
removing a soft link


Hi there,
I made a soft link to my /bin/ directory and now I want to remove it.
I created it as follows:
ln -s /bin/ binlink

neither "rm binlink" nor "unlink binlink" remove it. rm binlink yields the complaint that binlink is a directory, whereas rmdir and unlink say that it is not a Directory and refuse to remove it.

What do I do? Also, I am afraid of the sensitivity of the case since binlink is a link to my /bin/ folder.

ANy help is greatly appreciated.

P.S. I am going through a book on Linux, and I created the link just for testing purposes.
 
Old 01-01-2014, 05:11 PM   #2
doughyi8u
Member
 
Registered: Apr 2010
Posts: 227

Rep: Reputation: 10
have you tried using the -rf flag to rm?
Code:
rm -rf
 
Old 01-01-2014, 05:50 PM   #3
bibiki
LQ Newbie
 
Registered: Jul 2010
Posts: 19

Original Poster
Rep: Reputation: 0
are you sure this won't remove everything from my /bin/ folder? I have not tried it? I'd rather not take chances and see what happens. what do you think?
P.S. I actually tried rm-r, but not -f. To no avail....
 
Old 01-01-2014, 06:43 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,957

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
Plain old rm should work just fine. Do you perhaps have rm aliased to something strange? Try using a backslash prefix to bypass the alias:
Code:
\rm binlink
 
Old 01-01-2014, 06:53 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,876
Blog Entries: 1

Rep: Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997
As rknichols says, plain old rm will do it.

But be sure to NOT include the trailing '/' which will trigger the directory warning as it refers to the /bin/ directory itself - and yes rm -rf binlink/ WILL remove everythign from the /bin directory - DON'T DO THAT!.

Code:
rm binlink/ - refers to the directory linked, i.e. /bin/

rm binlink - refers to the symlink itself

Last edited by astrogeek; 01-01-2014 at 06:55 PM.
 
2 members found this post helpful.
Old 01-01-2014, 07:03 PM   #6
bibiki
LQ Newbie
 
Registered: Jul 2010
Posts: 19

Original Poster
Rep: Reputation: 0
rm binlink (wiithout the trailing slash worked fine).

I used tab for autocompletion of the link name and it adds the trailing slash, that's why it did not work.
Thanks a lot everyone, doughyi8u, rknichols, astrogeek.
 
  


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
Difference Between Soft Link & Hard Link rajaniyer123 Solaris / OpenSolaris 16 09-30-2012 04:42 AM
removing a soft link quietguy47 Linux - General 3 12-31-2011 10:34 PM
create soft link and hard link in RHEL5 ramadas88 Linux - Server 6 09-15-2010 05:32 AM
hard link and soft link varunrapelly Linux - Newbie 9 10-02-2008 08:05 AM
Soft Link and Hard Link Moataz Red Hat 1 04-25-2005 07:30 AM


All times are GMT -5. The time now is 06:15 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration