 Okay, continuing right where we left off last time. Once again, all this week we're focusing on the basics of working in the shell, working in the terminal. Today, we're going to be playing with files and folders, or folders and files, however you want to say it. Quick, quick, quick review. We got stuff on the screen here. If we want, we can hit control L to clear it, or type the word clear and hit enter. Let's go, we'll print the output that you put in to the screen. We can redirect that to a file with the greater than, or greater than, greater than to append to a file. Give it a name, and then I also want to know over other stuff, in our tutorials, be sure to check out the playlist, watch the other videos if you're lost already, because that was just a quick review on some simple stuff. So now let's get looking into changing to different directories, folders, changing with, or viewing what's inside folders, getting information about those, and creating new folders. So right now, we're in a folder. The folder is in our temp folder, and it's another folder or directory called tutorial. Right now, there should be, I believe, three files in this folder from the one we just created. And two from the previous tutorial. The way we can see what is inside this folder, while we're in this folder, is we can type in the LS, which stands for list, a little list, what's inside that directory. We will hit enter, and we can see an output here of the three different files. Depending on how your system's set up, these might be color coded. That's great. Some systems have that set up by default. Others not. You might have to do it yourself. My system actually does, but I'm actually in a different shell than I normally use for these tutorials, because I just wanted to go back to the basics here. But we got three different files here that we've created. They're all text files. Once again, we can cap them out, either one at a time. So here's another thing I wasn't planning to teach you. If you have a cursor, you can double click, and by default, in most Unix environments, if you center click, which on most mice is your scroll wheel, if you click it down, that will paste. That's not just in a terminal. If you're working in Linux, that's pretty much everywhere. That may be true for other operating systems as well, Mac OS maybe, I'm sure with like BSD and other operating systems, it's probably too. Anyway, if you're working on Linux and you have a cursor, you should be able to double click to highlight or drag to highlight, and then center click to paste it. And it just gave me that, because I got all of this, which is a new line, so I thought I hit enter there. I'm going to hit control L to clear the screen, but once again, LS to list, and that just gives you a basic list. You can give it other options here, LS-L will give you a list view, which gives you some more information. Down over here to the right, you can see the name of the three files. You can see when that file was modified right here. Modified last. I'm completely not sure what that number is, and then there's other stuff here that I'm not really going to get into, but it's permissions, owner, group of that file. So oh, I know what this is, this is the size in kilobytes here. So we're going to hit LS-L again, and if we hit A, that will show you everything, including hidden files, which in a Unix-like environment, you create hidden files by naming them with a dot, a period at the beginning of the name, just a little tad information there. So we get a little more information here, basically the same information for those three files, but it also tells you the directory above where we're at, information about that, and the directory in what, you know, about that. So we also have, once again, this is kilobytes here. Let's make that a little bit easier to read, especially if you're working with big files. We can add another option here. So I hit up arrow to go back to the last command, LS-LA for list all, now I'm going to add H, which means human, human readable, we're going to hit enter there. So I know I said kilobytes earlier, didn't I? These are in bytes, yes, those are in bytes, H will make it show it in kilobytes or megabytes or gigabytes, depending on the size of the file, because you get into larger file sizes, and this number is going to get pretty big, and you're going to be like, oh, I'm trying to figure out, because there's no commas, what it is, the dash H will make it what's called human readable. So in this case, you're like, oh, we got 12,288 bytes, and human readable says, yeah, that's 12 kilobytes kind of rounds for you. So we've looked at what's in our files with the list command. Let's create a new directory. So let's say we want to create a new directory, a new folder within the folder we're in, I can say mkdir, so mkdir, make directory, and then give it the name of a directory. Now you can just type a name like newdir, newdir, yeah, anyway, and hit enter. And if we list now, you can see newdir is in there. And again, if you have color coded, it might be a different color than the other files. If I ls-l to list, you'll see here newdir, and it begins with a dash, with a d over here instead of a dash, that means it's a directory. Now you might say, oh, why didn't you name it newdir? Well we can name it that. You really, really, it's bad etiquette to put spaces in file names or folders, but if you really wanted to, you can put it inside quotations, that's one way of doing it. I hit enter now, and I list. You can see we have newdir here. It's kind of a little confusing just right here, it's like, wait, are these two separate files or one file? Because they're separated, it also, when you're scripting, it can cause headaches if you have spaces in file names or folders, so just avoid it. But if you must, just use quotations around it. So that we've created two new directories, let's say we wanted to change into one of those directories. We can use the cd command, change directory, and I'll say new d, and I'll hit tab, once again to autocomplete, and I'll hit enter. Now as you can see here, I am inside the directory. Now you're not always going to get a nice little prompt like this, but on most modern systems if it isn't like a stripped down, very basic system, you will get, it will show you what folder you're in. If it doesn't, and you're curious as to what folder you're in, you can do pwd, which I always say present working directory, but that's not right. I'm going to go with present working directory, I know that's wrong. Just remember it will show you what you're in, so pwd, and you can see the output is the directory you're in. Let me show you, let's say we want to go back to the folder we were in. Now we can either type out the whole thing, cd, forward slash temp, forward slash tutorials, and I can tab autocomplete to get there, or we can just do cd dot dot. Dot dot means go up one directory, go up one folder, hit that, and you can see I went back up one folder. I can do that again, dot dot, and now in my temp folder, I can go cd to change directory, and go into tutorial, and hit enter, and now I'm back into that tutorial folder. I'm able to do that because it knows that the tutorial directory I'm talking about is the one within the folder I'm in. If you're in another folder somewhere, so let's say I'm inside this new dir folder, and I say cd tutorial, and hit enter, it's going to go, what are you talking about? That directory doesn't exist. I don't know, I mean that folder can be anywhere on the system. It's not in the folder you're in, because if I list, you can see nothing. There's nothing. I'll do it again with a clear screen. List, nothing in this directory. So I can't change into a directory in this directory if it isn't there. So once again I can type out the whole thing, temp tutorial, or just cd dot dot to move up a directory. So let's see. We've viewed what's inside the directory in a few different ways. We've created a directory. We've moved to that directory. I think that's good for today. We'll end its tutorial there. Once again, I thank you for watching these basic tutorials. We as an eye, and I'm going to be posting new videos all this week, pretty much every day on just basic shell commands. I'm working in a bash shell, but most of these things will work the same or at least similar in other shells. Bash is probably the most common currently. Not saying it's the best. It's actually not what I actually use for my everyday work anymore. I used to. And now someone's going to ask what I've been using. I've been using Z shell. So but I'm using bash in these tutorials just because that's the most common. And most things are going to be pretty similar when it comes to the basic stuff. So thank you for watching. Visit my site, filmsbychrist.com. That's Chris at the Cab and doing tutorials for years. So if you're new to this, go there. I've got a lot of tutorials, a lot of them are going to be over your head. But I try to explain things simply. But I also have a lot of basic stuff too. Everything should be in playlists. And I have tutorials on other programming languages and just other stuff in general. So check that out. I thank you for watching and I hope that you have a great day.