1 00:00:06,700 --> 00:00:09,740 In this video I would like to tell you about hard and symbolic links. 2 00:00:10,589 --> 00:00:13,189 It's all about file names and making them more accessible. 3 00:00:14,269 --> 00:00:18,289 File names are stored in an internal structure that is known as the directory table. 4 00:00:19,489 --> 00:00:23,699 And a link is a pointer in the directory that refers to another file or directory. 5 00:00:24,370 --> 00:00:25,410 And there's two types of them. 6 00:00:26,420 --> 00:00:30,059 Hard links are pointing to the same inode on the same file system. 7 00:00:30,960 --> 00:00:34,570 Now what is an inode? The inode is the unique administration that exists 8 00:00:34,570 --> 00:00:38,179 for all files and in which the properties of your files are stored. 9 00:00:39,539 --> 00:00:43,299 Symbolic links are shortcuts and they add additional flexibility. 10 00:00:44,780 --> 00:00:49,500 Now symbolic links can exist on a directory, which is not the case for hard links. 11 00:00:50,500 --> 00:00:55,399 You can also create cross device symbolic links to point to files that exist on another device. 12 00:00:56,899 --> 00:01:03,380 In general, links can be useful to ensure that specific information is available at different locations. 13 00:01:04,280 --> 00:01:10,469 Before I show you how to work with them, let me make a drawing that is making it clear how exactly these links are organized. 14 00:01:12,390 --> 00:01:18,520 Let me explain hard links and symbolic links. In order to understand we need to know a little bit more about 15 00:01:18,520 --> 00:01:24,650 the file Files is in the end all about blocks, blocks of data that is stored to your hard disk. 16 00:01:25,689 --> 00:01:28,989 These blocks need to be made accessible and they need to be managed. 17 00:01:29,590 --> 00:01:34,799 And in order to do so, the Linux file system provides the inode. 18 00:01:35,540 --> 00:01:39,175 The inode is a complete administration of a file. Every file, no matter 19 00:01:39,175 --> 00:01:42,810 which file system it is, has an inode and one inode only. 20 00:01:43,750 --> 00:01:49,604 Now the funny thing about inodes is that in the inode you don't have the name of 21 00:01:49,604 --> 00:01:55,459 the file. And for that reason you can have multiple names like name one and name two. 22 00:01:56,900 --> 00:02:02,579 And these names are independent of one another. So it doesn't matter which one you make first, doesn't matter which 23 00:02:02,579 --> 00:02:08,259 one you remove first. There is no dependency between these names. They are just a pointer to the inode. 24 00:02:09,219 --> 00:02:11,360 Now these names is what we call hard links. 25 00:02:14,259 --> 00:02:15,629 There's also a symbolic link. 26 00:02:16,129 --> 00:02:20,439 And the difference is that the symbolic link is a name that is pointing to a. 27 00:02:21,219 --> 00:02:28,099 So we have symbolic link one and we have symbolic link two. They offer a little bit more flexibility as I will explain in a bit. 28 00:02:28,879 --> 00:02:35,014 But there's also one problem. If something happens to name one, then your symbolic links become invalid. So 29 00:02:35,014 --> 00:02:41,149 there's a dependency relation there. Symbolic links go to a name and they don't go to an inode.