 Hello and welcome. This video is part of a series. It's part of a playlist. Check out the playlist in the links in the description of this video. I hope that you're enjoying the series so far. I hope you continue watching. If you see a video that isn't released yet, it's saying you can't access it. It's because it hasn't been posted yet. Pay Transporers get early access to video, so hopefully, if you're a Pay Transporter, you've got this as a download already early on. Today we're going to be looking at the PWD command. Let's type that in. PWD is going to tell me where I am. I'm in my home directory. If I was to move directories, say, into my WWW folder here on this PWD, it will tell me right where I'm at. If I move back out, I can PWD again. It will tell me what directory I'm in. In previous videos, we talked about the command command and the type command. Let's go ahead and use type this time, dash A. Then we'll type in PWD. Look at this. A lot of commands will tell you the location of that command, or if it's a built-in command, or if it's a function, or if it's in your RC file. In this particular case, it's telling me that it's built into the shell, but then it's also giving me an external executable. Why is that? Well, sometimes you come across some commands that are built into the shell, but then there's sometimes they are also external commands, and sometimes they work a little different. Let's have a little bit look at this. I am in a bash shell right now, and if the built-in bash, so if I was to type in, as we learned in a previous video, help PWD, you can see here that it will print the name of the current working directory. It has two options, L and P here, and the L prints the value of PWD, which is a variable in your shell, if it's named, is the current working directory. And it tells you right here that it behaves with the dash L by default. So, again, if I PWD, it's going to tell me what directory it is. Let me move into my temp folder here, though, and I'm really going to quick, I'm going to make a link file, dash S, and I'm going to say dot test. And now if I list out, I can move in to this test link, and you can see I'm in the same folder. Now, if I was to type in this command, the PWD command, it's telling me I'm in temp test. But if I was to type in the full path to the external executable, and hit enter, you see it's telling me that I'm in temp, because the L, which is the default on the built-in, will tell you for links, the external command does not do that by default. So again, PWD will tell me where I am, including the link, where the external command will tell me that I'm in temp, because the link is pointing, the link is linking to temp. Hope that makes sense. But if I can add in that capital L, and the external command works the same. The difference between the two in this case is that the internal command defaults to having that dash capital L for symbolic links. So if I was to type in manpwd here, we're getting a man page here. But this man page is for the external command. You can see right here it uses the PWD from the environment, even if it contains symbolic links. That's the capital L, and it doesn't say anywhere that it uses that by default. And if we say help, PWD, we get the help command for the internal command, which says that it does use, it behaves with that. So there is a difference for the most part in the same programs, but that could mess you up if you're writing a code and you're trying to see when you're in a certain directory that's a symbolic link, and your program's checking that, and it's getting, no, it's not. Well, that's because it's not using the dash L. So it is important to know which one you're using, and different shells may act different. Again, I'm in the bash shell. So these are things you need to know so that you don't mess up your code. Bash is probably one of the most common shells out there that is used by default, but it's not always, especially if you're working on lightweight devices like a router or a modem or even a cell phone. So I just wanted to point that out. There's other commands like this as well. But again, so reviewing this video and previous videos, if we type dash A and the PWD command, it's telling us that there is a built-in version of that program and an external, and for the most part, they're the same, except for the built-in looks at symbolic links by default. You can find out how to use the built-in one with help PWD. You can find out how to use the external one with man PWD to see the differences, which they both have the same options. It's just one default to another. And that's pretty much it. I do thank you for watching. I hope you found this useful. I hope you found this interesting. And if you did, be sure to like, share, subscribe, and comment. I hope you keep watching my videos. I got plenty of them. Visit filmsbychrist.com. That's Chris Decay. Link in the description of the video. You can search through my videos from both my channels there. I do appreciate you watching. Think about supporting. We're at patreon.com. There's a link in the description of the video. As well as on my website under support, you can support at Patreon or through PayPal. You can't support me financially. Think about liking, sharing, and subscribing to my channel. And again, as I said in the previous video, I use ad blockers. I completely understand. I'm not holding it against you. But if you could occasionally turn them off while you're watching my videos, I would appreciate it. I do thank you for watching. And as always, I hope that you have a great day.