Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Navigating Directories

00:00 You basically showed me that a file is there, so you basically already did what I wanted you to do—to go back into the pb_terminal/ folder, and you did it with the cd ... Yeah.

00:12 So, that’s basically, like, how you move back, so if you are cd and then a folder name, you are moving into the folder, and if you want to move one level up—So, I’m always confusing this—like, do you move it down or move up?

00:26 So, if you go one folder up, you’re using .., and if it would be multiple folders that you want to go up, you would combine them with a / (slash), like cd ../../...

00:40 You could keep going like that, but for now, it’s only .. because I want Martin to be in the pb_terminal/ folder again. Can Martin do a little detour again? Please, please, please. Okay, if it’s not—I mean, you can always show where we are with pwd, so you can take a detour there. So, my detour is about the .. actually. A lot of these commands have additional options. So, ls, for example, has—you can add an option a or an option l or both together.

01:11 And if you do this—this is one that I run relatively often—it gives you more information about the files that are inside of your folder than if you just run ls. Like you said before, if I say ls, I just get the names. If I say ls then with the option -al, then I get more information about them.

01:26 So this is some permissions, then I think it’s like how many links in there, who owns it? I don’t actually know what all of those mean off the top of my head. Okay. Yeah.

01:36 And some other information. And here you can see that it doesn’t only contain the hello/ folder and the file, but also . and .., and those are just links, basically. The . is a link to the current folder, and .. is a link to the previous folder. That’s why when you say cd .., you’re actually going into this folder that is part of every folder.

01:59 It’s a link to the previous folder, if that makes sense. Okay, yeah, that makes sense. I think that’s good to know that, like, it’s not just those plain commands, but usually there are multiple ways.

Become a Member to join the conversation.