LinuxQuestions.org
Help answer threads with 0 replies.
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 11-25-2004, 06:06 AM   #1
david@aber
Member
 
Registered: Jul 2003
Distribution: Multiple
Posts: 34

Rep: Reputation: 15
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
 
Old 11-25-2004, 07:19 AM   #2
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Ċrhus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
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
 
Old 11-25-2004, 07:37 AM   #3
david@aber
Member
 
Registered: Jul 2003
Distribution: Multiple
Posts: 34

Original Poster
Rep: Reputation: 15
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
 
Old 11-25-2004, 07:45 AM   #4
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
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?
 
  


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
Linking Directories utahcon Linux - General 1 08-11-2004 06:54 PM
Symbolic linking directories leecming Linux - General 1 06-08-2004 11:11 AM
problems linking programs directories in my path jimdaworm Linux - Newbie 9 04-14-2004 03:27 PM
symbolic linking directories? Possible? ajspliffs Linux - General 3 01-12-2004 11:55 AM
Apache - problem linking to other directories Peanut Linux - Networking 5 11-30-2003 12:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:31 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