Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-15-2009, 01:27 AM   #1
LQ Newbie
Registered: Dec 2008
Posts: 11

Rep: Reputation: 1
Can I make symbolic link relative??

Hi all

Not quite sure how to explain this but I have a problem with creating a symbolic link that then has another symbolic link in the directory underneath that points back to a directory.

I'll try and show an example

$ ls -l /home/mydir

lrwxrwxrwx 3 user group 4096 Aug 27 2009 dog -> /d01/bart/dog
drwxr-xr-x 3 user group 4096 Aug 27 2009 bin
drwxr-xr-x 3 user group 4096 Aug 27 2008 top

$ cd /home/mydir/dog
$ ls -l

drwxr-xr-x 1 user group 33 Oct 15 15:31 yellow_dir

$ cd /yellow_dir
$ ls -l

lrwxrwxrwx 1 user group 33 Oct 15 15:31 cat -> ../../top/cat

Is there anyway to avoid using the full path to /home/mydir/top/cat ?
as if yellow_dir was actually a sub-directory of /home/mydir/dog?

The reason is that when I clone this environment, some of the directory paths have different environment names in (like DEV or TEST) and using
relative paths means I dont have to worry about re-naming?

Hope I have explained?

Old 10-15-2009, 01:38 AM   #2
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
There's no problem in doing that, for example:

ln -s .. foodir


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
How to make a symbolic link ? chrislabricole Red Hat 5 01-29-2009 07:44 AM
The command to make a symbolic link Gins Linux - General 10 11-12-2006 02:58 PM
How to make a symbolic link permanent royeo Linux - Software 1 10-06-2006 01:47 PM
cannot make symbolic link dave`2005 Debian 3 10-08-2005 11:15 AM
How to make symbolic link? Tommi Linux - General 9 05-07-2003 09:58 AM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration