Page 1 of 1

On the topic of soft links creation

Posted: Thu Feb 12, 2015 1:58 am
by medinita3586
Hello, I am here stuck in the Linux solar system again, trying to answer question 8 on the tutorial 3 which requires of me to create a soft link file named "mylink" that points to the file "home/demo/thismonth" file and after many unsuccessful commands, I have almost come to the completion of this problem but... I am not there yet, not quite.

I am now doing: "ln -s home/demo/thismonth /home/demo/work/programs/mylink" and when I check the result, it passes the first two questions but seems like I am not making my soft link called "mylink" point to the "thismonth" file, why? What am I doing wrong?

Sorry but I am stuck and would love to continue on my journey to the Linux Nirvana.

Thanks in advance. :cry: :shock:

Re: On the topic of soft links creation

Posted: Fri Feb 13, 2015 11:34 am
by drgrussell
If your link is /home/demo/work/programs/mylink, and you add your "relative" link to that, then this will point to
/home/demo/work/programs/home/demo/thismonth
In short, the link is appended to the location of the link when you use relative linking.
In fact you need to go up the tree two levels from programs to find thismonth relatively.
Not only that, there is no "Programs" directory... do you mean progs?

so not "home/demo/thismonth" but "../../thismonth".

Re: On the topic of soft links creation

Posted: Sat Feb 14, 2015 2:44 am
by medinita3586
Actually I meant "progs", I will try that as soon as I can.

Thank you very much :P

Re: On the topic of soft links creation

Posted: Sun Feb 15, 2015 8:00 pm
by medinita3586
Alright, that really works! So that that command gives: "../../thismonth /home/demo/work/progs/mylink " the relative path to the "thismonth" file, right? I had no idea you could use the "../" command that way. And it also makes the "mylink" file point to the "thismonth" file, doesn't it? Very interesting, I could not have figure that out on my own, really. That stuff of moving from directory to directory using relative paths have been bugging me ever since I started learning Linux

Thank you so much... :lol: