LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   linking directories (https://www.linuxquestions.org/questions/linux-newbie-8/linking-directories-259126/)

david@aber 11-25-2004 06:06 AM

linking directories
 
Hi All,

This question has probably been asked before, but i can't seem to find a answer which works.

My problem is linking one directory to another. What i want to achieve is the following:

/data/ISO -> /data/IDE/ISO

I have tried ln -s and can't seem to get it to work.


Please can you help

David

otoomet 11-25-2004 07:19 AM

Hello,

Quote:

/data/ISO -> /data/IDE/ISO
So /data/IDE/ISO exists and you want to make a shortcut /data/ISO?

from man ln:

Quote:

NAME
ln - make links between files

SYNOPSIS
ln [OPTION]... TARGET [LINK_NAME]
ln [OPTION]... TARGET... DIRECTORY
ln [OPTION]... --target-directory=DIRECTORY TARGET...

DESCRIPTION
Create a link to the specified TARGET with optional LINK_NAME. If
LINK_NAME is omitted, a link with the same basename as the TARGET is
created in the current directory. When using the second form with more
than one TARGET, the last argument must be a directory; create links
in DIRECTORY to each TARGET. Create hard links by default, symbolic
links with --symbolic. When creating hard links, each TARGET must
exist.
ln -s /data/IDE/ISO /data/ISO

what happens, why cannot you link them?

You may also consider mount --bind where you mount one directory to another place. I don't know what are the advantages of the second approach.

best,

Ott

david@aber 11-25-2004 07:37 AM

Thanks that worked I think I had ln -s /data/IDE/ISO /data/ISO/ note the extra / at the end

Thanks again for your help

Darin 11-25-2004 07:45 AM

The key part is where the man page shows it as ' ln [OPTION]... TARGET [LINK_NAME]' so it goes 'ln -s /DIR_TO/TARGET_NAME LINK_NAME' which to me seems backwards. This always throws me off when I make a link since I always try 'ln LINK_NAME TARGET' and then have to remember that it's backwards. Or maybe I now know to put the target first but still think it's backwards so I type it wrong anyhow? :confused:


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