RE: [SLUG] Linking Directories

From: Sick Twist (thesicktwist@hotmail.com)
Date: Sun Apr 17 2005 - 12:36:51 EDT


>From: SOTL <sotl155360@earthlink.net>
>Reply-To: slug@nks.net
>To: SLUG Linux <slug@nks.net>
>Subject: [SLUG] Linking Directories
>Date: Sun, 17 Apr 2005 09:56:38 -0400
>
>Hi All
>
>From discussions I has at the last Dunedial meeting I thought links were
>simple but I have found differrent.
>
>I have a copy O\of O'Reilly Pocket Guide to Linux and a copy of Practical
>Linux but neither appear to discuss what I would like to do.
>
>Lets assume I have a file: testfile1
>I can link test1 to a secton file called testfileln1 by
>$ ln -s testfile1 testfileln1
>
>well and good.
>
>But what I would like to do is do this with with two directories say
>testdir1
>and testdir2.
>
>Lets let testdir1 contains files testfile1 and testfile2.
>Now I would like to link testdir1 to testdir2 so that all files in testdir1
>appear in testdir2. That is when I open testdir2 I see all the files in
>testdir1.
>
>I would appreciate someone explaining how one does that.
>
>Thanks
>Frank

ln -s /path/to/testdir1 /path/to/testdir2

The -s option is to make a symbolic link. The second argument is the path
to the target directory. The third argument is the path to the directory
that will point to testdir1. Testdir2 should not exist before you do this
command otherwise ln will not overwrite it.

If you would rather make multiple links to multiple files you could do
something like this:

ln -s /path/to/testdir1/* /path/to/testdir2

In this instance testdir2 should already exist. When using multple targets
the last argument must be a directory so that ln knows where to put them
all.

-Jonathon

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:43:11 EDT