Hard vs Soft Links in Linux (Linux Links)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Linux links so for every file in our file system there exists an index node or an inode and inode 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 inode like a personal ID or a passport but without your name on it typically they contain the following the inode number which is very important as we will see file size in bytes the owner of the file permissions file type number of link etc here will focus on links there are two types of Link's the first one is soft link so if you are familiar with Windows you you will know what is a shortcut and basically a soft link is the same like a shortcut in Windows soft link sometimes is also known as symbolic link so if you know what a shortcut in Windows is you will probably know that it's a pointer it's a file pointing to another file right and you also know you'll 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 an inode number of a soft link is different than the inode number of the original file so here is a visualization of soft links here we have original file with an inode number of 100 and we have two soft links or two shortcuts one with an inode of 200 and one with an inode of 300 as you can see the inode numbers differs when we are dealing with soft links if we delete the original file the soft length 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 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 at a shortcut however it has exact same file size and the exact inode so you cannot actually differentiate between an original file and a hard link here's a visualization of a hard link so here we have an original file which had an inode number of 100 and we have two hard links observe here that all three files have the exact same inode number and all three files have the exact same file size and if you delete the original file this will not affect by any means the hard links the earth 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
Info
Channel: Ahmed Alkabary
Views: 96,861
Rating: undefined out of 5
Keywords: linux, ubuntu, fedora, centos, operatingsystems, os, links, filesystem, redhat, lfcs, lfce, rhcsa, rhce, comtpia, linux+, udemy, operating, unix, kernel, windows, shortcuts, ccna
Id: 4-vye3QFTFo
Channel Id: undefined
Length: 4min 0sec (240 seconds)
Published: Sun Oct 15 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.