Example symlink to a single directory

Include a single “<TARGET>” variable, defining it as the complete path to a desired directory. The system will create a symbolic link using the value defined as the "<LINKNAME>" variable.

Note: NetStorage doesn't support the creation of hard links. The creation of a symlink is implied and the -s option is applied by default.
Command format
ln <OPTION> <TARGET> <LINKNAME>

Symlink to a single directory

When you create a symlink to a directory, it will display all content of the target directory. To create a symlink in your current directory for a directory located at /123456/videos, execute this command:

ln -v /123456/videos /123456/symlinks
Example link creation output

In this example, we've included the "-v" <OPTION> to display the step by step execution from the /123456 directory.

[123456]$ ln -v /123456/videos /123456/symlinks
create symbolic link /123456/symlinks to /123456/videos
Example list output

Performing a list (ls -l) shows the symlink relationship to the target.

[123456]$ ls -l
lrwxrwxrwx storageGroup  storage           14 Mar 26 21:07 symlinks -> /123456/videos
drwxrwxr-x storageGroup  storage            0 Mar 26 20:21 videos
Example symlink directory listing

You can access all files in the targeted directory by using the new symlink directory. This example demonstrates that the new /123456/symlinks directory is displaying the content from the targeted /123456/videos directory.

[symlinks]$ ls -l
-rw-rw-r-- storageGroup  storage        78612 Mar 26 20:08 movie.mp4