LinuxMoz

Linux Stuff && Coffee

How to Create a Symbolic Link (Symlink or Soft Link) on Linux

| Comments

A symbolic link is a link to a file or directory at another location on the file system. For example if you moved the location of /var/log/mail to another drive or file system location you could create a symbolic soft link to the new path, preventing scripts and other programs that use this path from breaking. The commands below demonstrate how to create a symbolic link on Linux / Unix systems.

Note: Symbolic links are often called soft links or symlinks.

Linux create symbolic link – soft link

90% of the time you will use a soft link when you create a symbolic link (sym link for short) on Linux.

To create a symbolic link using a soft link enter the following:

1
ln -s /path/to/file/or/directory/name link-name

Create hard link

To create a hard link enter the following command:

1
ln /path/to/file/name link-name

Drop me a comment below if this how to create symbolic links helped you out :)

Comments