See:
mkdir sym
cd sym
mkdir one
//Create the symlink
ln -s one two
ls -l
drwxr-xr-x 2 lola lola 4096 2012-02-14 07:58 one
lrwxrwxrwx 1 lola lola 3 2012-02-14 07:58 two -> one
Now, if I put something in one I could reach it in two. For what I understand two is the name of the symlink, and creates a directory to it (namely, two) [is this correct?].
Question: Is two is a directory that points to one?
But if I do:
(assuming a clean configuration)
mkdir sym
cd sym
mkdir one
mkdir two <--- notice the creation of two!!
//Create the symlink
ln -s one two
drwxr-xr-x 2 lola lola 4096 2012-02-14 07:59 one
lrwxrwxrwx 1 lola lola 3 2012-02-14 07:59 two
but in two/
lrwxrwxrwx 1 lola lola 3 2012-02-14 07:59 one -> one
If I put something in one I cannot reach it in two.
But from man ln:
SYNOPSIS
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)
I’m trying to do the 3rd form, that is: create a symlink from one directory to another directory.
Could you give me a hint about my mistake? I think is conceptual (and technical).
In your first example, “two” is not a directory. It is a simlink (basically a small label that says “if someone asks for me, look in “one” in stead.
In the second case, you indeed use the 3rd form. However what this form does is “Make a simlink to TARGET inside directory DIRECTORY. Because “two” is a directory, the ln command recognizes the second example as the 3rd form.