How to Create a Symbolic Link Linux?
Contents

To create a symbolic link pass the -s option to the ln command followed by the target file and the name of link.

In the following example a file is symlinked into the bin folder.

In the following example a mounted external drive is symlinked into a home directory.

A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system.

rm and unlink commands to remove symbolic link. rm: is the terminal command to remove each given file including symbolic links. Because a symbolic link is considered as a file on Linux, you can delete it with the rm command.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest