`
If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Command Line 4
Links and Symlinks







Linux Command Line (12) Linking Files and Directories

The video starts by explaining that Linux stores files with inodes and every file must have an inode

Hard linked files will have the same inode number and use the same data

A hard link is created with the command ln then the existing file or the file we want to link to and then the new linked filename.

ln file.txt newlinkedfile.txt

Hard linked files can be moved or renamed or delete and the data will remain in tact until the last hard link is delete, then then the file is deleted.

Hard links must be made on the same partition and directories can not be hard linked


Symlinks are also called Soft links and those are created with the same command, but adding the -s option for symbolic link.

The symbolic is linked to the filename and can be linked to directories and on different partitions.

The file the links are attached to, can not be moved or renamed or the symlinks for that file break. Moving or renaming the file back to the original name and linked location will restore the broken sym-link.