Garthus
1 min readSep 14, 2020

--

What is the difference between a hard link and a symbolic link?

On linux systems, you can make links between files using the ‘ln’ command. You can create two types of links :

  • symbolic link : it’s an alias, a shortcut to a regular file.
  • hard link : it’s an additionnal name from an existing file, with the same inode.

Without any option, the ‘ln’ command create a hard link by default, if you want to create a symbolic link, you need to add an option the command ‘ln -s’.

on the example above, i created a regular file named ‘hello’, a symbolic link of hello named “hello1"and a hard link named “goodbye”.

the ls command allow us to list the files, we can notice that :

  • goodbye is a regular file and has the same inode as hello
  • hello1 a symbolic link to hello “hello1 -> hello” and the “l” meaning link on the rights field.

--

--