Hard Links vs Soft Links

Ahmed Alkabary
A free video tutorial from Ahmed Alkabary
Professional Linux Administrator - 150,000+ Happy Students.
4.5 instructor rating • 3 courses • 156,899 students

Lecture description

Understand the two types of Linux Links and realise the differences between them.

Learn more from the full course

Linux Command Line Basics

This is an introductory course to the Linux command Line. It's great for both Linux beginners and advanced Linux users.

04:59:26 of on-demand video • Updated May 2020

  • realize the potential of the Linux command line.
  • navigating the Linux Filesystem.
  • explain the Linux Filesystem hierarchy.
  • use command options.
  • create hard and soft links.
  • use powerful Linux wild cards.
  • create,view and manipulate files.
  • use different Linux text editors (nano,gedit).
  • find help while using the Linux command line.
  • create you own Linux commands .
English [Auto] Linux links so for every file in our file system there exists an index note or an I note and i node is like a database of a file so it contains many many information about the file. However it does not contain two important things. It does not contain the file content and it does not contain the file name. So you can think of an I know like a personal ID or a passport but without your name on it. Typically they contain the following. The i node number which is very important as a rule c file size in bytes the owner of the file permissions file type number of linked cetera. Here we are focused on links. There are two types of links. The first one is soft link. So if you are familiar with Windows you will know what is a shortcut and basically a soft link is the same like a shortcut in Windows thof link. Sometimes it's also known as a symbolic link. So if you know what a shortcut Windows is you'll probably know that it's a pointer. It's a file pointing to another pine. Right. And you also you also know that the file size of a shortcut is usually smaller than the file size of the original file. And here we have the same concept. However you have to know one more thing that. And I know a number of a soft link is different than that I know a number of the original file. So here the visualization of soft links here we have it original file with an I know a number of 100 and we have two soft links or two shortcuts one with an I know of two hundred and one with an I know of 300. I can see the I know numbers that differs when we are dealing with soft links. If we delete the original file the soft links will become useless pretty much like shortcut in Windows right. If you delete the original file the shortcut will be useless. There is another type of link in the Linux file system. This one is called a hard link So a hard link is basically a different name of the same file. So it's pretty much the same exact file. Unlike a soft link it has the same file size like the original file so you can think of it as a shortcut. However it has the exact same file size and exact. I know. So you cannot actually differentiate between an original file and a hardlink. The visualisation of hardlink. So here we have an original file which has an odd number of 100 and we have two hard links are observed here that all three files have the exact same. I know a number and all three files have the exact same file size and if you delete the original file this will not affect it by any means. Hard length they are. They are kind of like a copy. It's like a copy not a shortcut. Right so you can think of a soft link like a shortcut and you can think of a hard link like a copy of a file. So next video we will learn how to create soft and hard links using the commands. Ciao. I'll see you next video you.