LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-22-2008, 01:34 PM   #1
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Fedora 14, Ubuntu , Slax 5.1.8, OpenSolaris, Centos 4.8
Posts: 296

Rep: Reputation: 30
Symbolic link does not work ( or is it me ) ?


Hi there.
I created a small text file and saved it as data.txt. I then proceeded to make a symbolic link to this file :

Code:
$ ln -s data.txt data.sym
I done a "cat" on data.sym and I got a listing of the contents of the original data.txt file. I moved the symbolic link to a different directory, cd to that directory and when I cat the symbolic link I get
Code:
cat: data.sym: No such file or directory
I was expecting the contents of the data.txt file to be shown.

I also done this :

Code:
$ ln -s data.txt ~/temp/data.sym
I moved to the temp directory and same thing again, I done cat on data.sym and got the "No such file or directory" error. Is this expected behaviour ? If so why ? The original file and symlink don't have to reside in the same directory do they ?

Thanks
UC
 
Old 10-22-2008, 02:40 PM   #2
Total-MAdMaN
Member
 
Registered: May 2008
Distribution: Gentoo
Posts: 306

Rep: Reputation: 34
I'm not sure why the second one is having problems, but the problems with the first could be because you moved the symlink. It is looking for the file in the current directory, as you created it in the same directory as the file it references. When you moved it it's now looking for the original file in the directory you moved the symlink to.
 
  


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
symbolic link not allowed or link target not accessible paullaubscher Linux - Newbie 4 03-10-2010 07:47 AM
Symbolic Link metallica1973 Linux - Networking 4 09-01-2008 12:13 AM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 08:40 AM
Symbolic link does not work via SAMBA ibex Linux - Networking 1 09-29-2006 05:05 PM
symbolic link can't work under ftp Joe_Zhu Linux - Networking 2 06-07-2006 03:18 AM


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