Symbolic links in Linux is the same as creating a shortcut in Windows.
Use the ln command to create symbolic links. I was a little confusing to me when I was learning about it. But, then I got it. After a walk in the new Long Island RR station at the Grand Central Terminal in New York City. I decided to put together some examples:
To create a symbolic link to a file using the ln command.
ln -s source_file optional_symbolic_link
Always remember to use the switch -s. If not, you will create a hard link instead. Remember, the ln command will only give and output when it fails, otherwise nothing will be return nothing if successful.
Now check that a symbolic link was created by running ls -l
lrwxr-xr-x 1 rgm staff 6 Mar 16 14:29 link_file -> source_file
If you see the ‘l’ at the beginning of the output it means ‘this is a symbolic link’ Also, the part link_file -> source_file showing that arrow means a symbolic link was created.
Same process work for creating symbolic links to directories.
To remove symbolic links there are two options:
The ‘link_file’ does NOT need to be created first. I was confused by this. As you can see creating symbolic Links in Linux is quite simple.
Contact me if you have any questions. You can also leave a comment below.