man ln
shows:
NAME
ln - make links between files
SYNOPSIS
ln [OPTION]... [-T] TARGET LINK_NAME
ln [OPTION]... TARGET
ln [OPTION]... TARGET... DIRECTORY
ln [OPTION]... -t DIRECTORY TARGET...
DESCRIPTION
In the 1st form, create a link to TARGET with the name LINK_NAME.
In the 2nd form, create a link to TARGET in the current directory.
In the 3rd and 4th forms, create links to each TARGET in
DIRECTORY. Create hard links by default, symbolic links with
--symbolic. By de‐fault, each destination (name of new link)
should not already exist. When creating hard links, each
TARGET must exist. Symbolic links can hold arbitrary text; if
later resolved, a relative link is interpreted in relation to its
parent directory.
To make a link using the first form use: ln -s ../../10/wsl wsl
.
With the second form you should be able to: ln -s ../../10/wsl
.
Both of these will create ./wsl
.
I see you've already tried the second form, therefore these could be some of the problems you ran into:
$ ln ../../10/wsl
ln: ../../10/wsl: hard link not allowed for directory
$ ln -s ../../10/wsl
ln: failed to create symbolic link './wsl': File exists
In the first line, we forgot the -s
flag. In the second form, we already had a file in the current directory called ./wsl
. We will need to move or delete it if we want this command to work. If these aren't your problems, then post your output for further guidance.
Once you have your ln
command, you can try it out:
# The ls command shows the link
$ ls -l
wsl -> ../../10/wsl
You can cd in and out of that directory:
~ $ cd wsl
~/wsl $ cd ..
~ $
If you create a file here, you can also see that file appear in the original directory
$ touch wsl/file1
$ ls ../../10/wsl
file1
cd
. If you want to create a symbolic link, useln -s target link_name
,man ln
for more. – thanasisp Oct 26 '20 at 03:31