LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mistake with symlink (https://www.linuxquestions.org/questions/linux-newbie-8/mistake-with-symlink-742480/)

bobbinz 07-24-2009 09:52 AM

Mistake with symlink
 
Hi folks

I did something stupid with a symlink and wonder if I can recover. It was a mistake in my syntax:

sudo ln -s /opt/kde/bin/klibido /usr/share/bin

Obviously I forgot to put the file name on the end of the destination. So now what should be my /usr/share/bin directory is a symbolic link. Is there any way I can recover this, or are "real" the contents of /usr/share/bin gone forever?

Thanks for reading
BBz

bobbinz 07-24-2009 10:16 AM

Jeepers, what sort of a newbie am I? I was confusing /usr/share/bin for /usr/local/bin. Presumably it let me create the symlink because the former didn't previously exist?

Sorry for wasting your time...perhaps it's given you a laugh ;)

BBz

pwc101 07-24-2009 11:19 AM

Given the following:
Code:

ln -s SOURCE TARGET
If the TARGET argument to the ln command is a directory (with or without files in), ln will place a symlink in that directory called whatever the SOURCE is. It won't overwrite a directory with a symlink if that directory exists. If the TARGET argument does not exist, ln assumes that's the name you want to give the symlink.

knudfl 07-24-2009 11:33 AM

Or this method :

cd /usr/local/bin/
sudo ln -s /opt/kde/bin/klibido
... which will make the link in the current directory.

( Just try it with no 'cd' (and no 'sudo'), and the
link will appear in /home/"user"/ .)
.....


All times are GMT -5. The time now is 12:22 AM.