Welcome to LQ!
Before any explaination, I'd suggest you to once thoroughly go through the manual of ln
command (see here
Take a note:-
- A symbolic link is nothing but a shortcut to another file or directory.
- A .
in Unix means current directory, whereas ..
stand for parant directory of your current working directory i.e. one level up from your current directory in file system hierarchy.
In the screenshot you shared:-
is in playground
directory is inside playground directory. So:-
[me@linuxbox playground]$ ln -s fun fun-sym _______________ Means you've created a symbolic link of fun directory named fun-sym
[me@linuxbox playground]$ ln -s ../fun dir1/fun-sym ________ Means there's one more directory outside of playground with same name i.e. fun and you've create a symbolic link of that fun directory in dir1. Here target directory is fun and it's link is residing in dir1 with name fun-sym.
[me@linuxbox playground]$ ln -s ../fun dir2/fun-sym ________ Means one more directory outside of playground with same name i.e. fun and you've created a symbolic link of that fun directory in dir2. Here target directory is fun and it's link is residing in dir2 with name fun-sym.
Later, when you're checking links, as:
[me@linuxbox playground]$ ls -l dir1
...... fun-hard _____________ Means a hard link of fun directory
...... fun-sym -> ../fun _____________ Means a symbolic link named fun-sym of directory playground/fun
I suppose, that directory hierarchy is confusing you. So you can try the same on your test machine with different directories for clear understanding.
Just remember the syntax of ln
ln [OPTION] TARGET LINK_NAME