What is a symbolic link (symlink)?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're gonna go over what a symlink is and how to create one so essentially a symlink is similar extends first symbolic link and a symlink is essentially a shortcut and it's a shortcut that is generally used on the command line or in systems administration or in more technical things than just creating shortcuts on your desktop although will show up basically it will look like a shortcut on your desktop so in order to create a symlink you would do Ln - s and then you will have the source file and then your symlink file so let's go ahead and create a source file we'll just do this with text files so let's start with my file dot txt we'll just create that and then let's edit this really quickly and say I have something important to say not really but we will just go with that and claim that we do and then if we're going to so let's make sure that we're getting in here to the spot where we can see our file okay so we've got my file dot txt and if we were to look in that and we can see I have something important to say all right so now that we have that file let's go ahead and create a symlink so make sure to include this - s otherwise you'll be creating a hard link which will basically create an exact copy of the file that that stays linked so hard links aren't used as much as symbolic links there are uses for them but we won't go over that in this video so we're gonna use - s and then we'll want to use my file dot txt and then maybe we for the sim link we will have like this new name that needs to be used so we create this new name and just like I mentioned it's going to be a shortcut so you can see that it has this little shortcut icon it actually shows up as a shortcut in Mac and it behaves like a shortcut if I were to open this then it's actually opening my file dot txt okay it shows the exact text that I had and it behaves like we are opening my file dot txt it's just a shortcut to that same thing in here if I were to cat out new name from the command line then it's going to show the contents of my file txt if I were to inspect the contents of this directory Wow there are a lot of hidden files up here but if we look at new name dot txt then it's actually going to point to this my file dot txt so it won't show that if we just LS but if we LS la and it's going to show all the details and we couldn't see how that symlink is pointing here if we remove the the original my file txt then now this symlink is gonna be broken okay and so if we open this up it can't complete it and the same thing here let's see what it's called your name so if we can't that out there's nothing there because the symlink is not pointing anywhere now so if we do LS la it's still trying to point to this my file txt right but this does not exist actually so if we were to do my file dot txt again let's see if now it points back to it right so it points back to it again the the link is still there we created the file again so now the link is connected again so that is how you create symlinks that's what they do it's just Ln - s and then you're gonna have your source file or the file that you care about and then the actual symlink so as what siblings do that's how some links work and how to create them hopefully that helps you and we'll see you in the next video you [Music]
Info
Channel: Read Write Exercise
Views: 19,653
Rating: undefined out of 5
Keywords: what is a symlink, how to create a symlink, how to create symbolic links, what is a symbolic link, symlinks, symbolic link
Id: tkuYrwzQ7N4
Channel Id: undefined
Length: 4min 39sec (279 seconds)
Published: Mon Dec 02 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.