LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   removing a soft link (https://www.linuxquestions.org/questions/linux-newbie-8/removing-a-soft-link-4175489825/)

bibiki 01-01-2014 04:01 PM

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.

doughyi8u 01-01-2014 04:11 PM

have you tried using the -rf flag to rm?
Code:

rm -rf

bibiki 01-01-2014 04:50 PM

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....

rknichols 01-01-2014 05:43 PM

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

astrogeek 01-01-2014 05:53 PM

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


bibiki 01-01-2014 06:03 PM

:) 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.


All times are GMT -5. The time now is 05:54 PM.