LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-24-2009, 10:52 AM   #1
bobbinz
LQ Newbie
 
Registered: Jul 2009
Location: Manchester, UK
Distribution: Ubuntu 11.10
Posts: 11

Rep: Reputation: 0
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
 
Old 07-24-2009, 11:16 AM   #2
bobbinz
LQ Newbie
 
Registered: Jul 2009
Location: Manchester, UK
Distribution: Ubuntu 11.10
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 07-24-2009, 12:19 PM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
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.
 
Old 07-24-2009, 12:33 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
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"/ .)
.....
 
  


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
Would a symlink help ? budword Linux - Software 4 07-11-2007 01:47 PM
where is symlink? guitarfella Slackware 3 12-04-2004 08:34 AM
symlink mikedelo Linux - Software 2 03-28-2004 01:32 PM
symlink evannextel Linux - Newbie 1 09-17-2003 04:54 PM
Symlink Mestax Linux - Newbie 3 09-04-2003 01:07 PM


All times are GMT -5. The time now is 10:33 PM.

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