Hard And Symbolic Links On Linux, How To Create Them, And What Is The Difference Between The Two

“The pioneers used to ride these babies for MILES!”

There is a meme I can’t find about a Mom deleting a game on her child’s computer, but the child isn’t too bothered because she only deleted the shortcut to the game and not the actual itself. A symbolic link on Linux is like a Window’s shortcut: you can delete it, but the file that it points to remains untouched. They’re like weeds.

A hard link in Linux is a file that points to the inode of a file so that it gets all the attributes of the file. Basically, a hard link points to the same data block as the file, so accidentally deleting the file doesn’t mean you’ve lost access to the data if you have a hard link of that file.

Hard links aren’t recommended to use because they’re almost indistinguishable from the file they’re a link of. Filesystems can break. Gold turns into water. Black holes spawn from your living room.

So be on the safe side and use symbolic links:

ls -s [filename to link] [name of new symbolic link]

ls -l [fil

--

--