Example symlink to a single file

Include a single “<TARGET>” variable, defining it as the complete path to a desired file. 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

Symlink to a single file

To create a symlink in your current directory for a file located at /123456/videos/movie.mp4 called symlink.mp4, execute this command:

ln -v /123456/videos/movie.mp4 symlink.mp4
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/movie.mp4 symlink.mp4
create symbolic link symlink.mp4 to /123456/videos/movie.mp4
Example list output

The targeted /123456/videos/movie.mp4 file is accessible by using the new symlink located at /123456/symlink.mp4. Performing a list (ls -l) shows the symlink relationship to the target.

[123456]$ ls -l
lrwxrwxrwx storageGroup  storage           24 Mar 26 20:43 symlink.mp4 -> /123456/videos/movie.mp4
drwxrwxr-x storageGroup  storage            0 Mar 26 20:21 videos