Example symlink to multiple targets

Include multiple “<TARGET>” variables — defining each as the complete path to a desired file or directory, for which individual symbolic links will be created, and placed in the path named for the “<DIRECTORY>” 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> <TARGET> <DIRECTORY>
Note: The last argument must be a directory when making multiple links. You need to create the destination directory if it doesn't already exist.

Example of symlink creation with multiple targets

In this example, a single file as well as a directory are targeted for symlink creation.

ln -v /123456/videos/movie.mp4 /123456/videos/subtitles /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/movie.mp4 /123456/videos/subtitles /123456/symlinks
create symbolic link /123456/symlinks/movie.mp4 to /123456/videos/movie.mp4
create symbolic link /123456/symlinks/subtitles to /123456/videos/subtitles
Example symlink directory listing

Use your /123456/symlinks directory to access the original /123456/videos/movie.mp4 file and /123456/videos/subtitles directory.

/123456/symlinks$ ls -l
lrwxrwxrwx storageGroup  storage           24 Mar 26 21:41 movie.mp4 -> /123456/videos/movie.mp4
lrwxrwxrwx storageGroup  storage           24 Mar 26 21:41 subtitles -> /123456/videos/subtitles