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 10-15-2009, 12:27 AM   #1
sk1ds
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?

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

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

Code:
ln -s .. foodir
 
  


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


All times are GMT -5. The time now is 07:11 AM.

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