Links: how to create hard or symbolic links
You can make links between files in Linux. There are two types of links: hard links and symbolic links. In this tutorial I will show you the differences between the two and how to create them.
You can link files and directories, so any changes in one file (the SOURCE) will be reflected in the other file (the TARGET). There are two types of links: hard links and symbolic links.
Hard links are only possible with files on the same drive. You can use
link commands to create a hard link:
ln SOURCE TARGET link SOURCE TARGET
TARGETare file paths.
If you remove the source file, target file will remain with the contents of the deleted file.
You can link folders and files on the same or different drives with symbolic links. You can use
ln -s to create a symbolic link:
ln -s SOURCE TARGET
For example, if there is no
python executable on the system, but
ln -s /usr/bin/python3.9 /usr/bin/python
If you remove the source file, target file will be unusable.
If you have any suggestion, feel free to contact me via social media or email.