We've already used a bunch of Linux commands by now. So hopefully these commands aren't too foreign. You may remember that echo is a command used to print messages to the screen, cat is command for showing contents of files, ls is the command to list contents of a directory, chmod is a command to change permissions of a file, and so on. As we call that before, a lot of these commands come from Unix. Back in the 70s, when designing how these programs should behave, the philosophy was that they should do one thing and do it very well. Which means we have a lot of commands, each for doing specific thing. We'll go through them quickly. But as usual, we'll provide a Chichi afterwards that you can use as a reference. You have plenty of time to review these commands and practice on your own. So let's get started. To create a new directory, we use the mkdir command. To change into that directory, we use the cd command. As you might notice, these commands don't print anything to the screen. This is normal and to be expected. A lot of the commands that we'd use don't print anything when they succeed. They only print something if they fail. To check that the cd command succeeded, we can use a command like pwd to print the current working directory. Okay. We have a directory which is empty. We can copy files using the cp command. For example, we can copy the spider.txt file that we have in the parent directory. What are all those dots. These are shortcuts that we can use to refer to some special directories. But dot-dot shortcut reverses a parent directory, the previous directory and the absolute path while the dot shortcut reverses the current directory. So this command is copying the spider.txt file located in the previous directory to this directory. Does that connect the dots? We can also create an empty file using the touch command. So by now, we have two files in our directory; the spider.txt file that we copied and the myfile.txt that we created using the touch command. Let's look at the contents of a directory using the ls dash l command. Nice. We've now called the ls command using the dash l command line argument. Remember, command-line arguments let us change the behavior of commands making them do what we want. Without any arguments, ls would just list the names of the files contained in directory. By passing the dash l, we get a lot of extra information distributed in a bunch of columns. Pop quiz time. What are these columns? The first column indicates the permissions of the file. The second column is the number of i nodes that point to the file. The third and fourth columns indicate the owner and the group to which the file belongs. Then comes the size of the file that they've less modification and finally, the name. In our case, we have the file that we copied which has 192 bytes and another file that we created, using the touch command, which has zero bytes. Let's check out another ls command line argument. By calling ls dash la. The dash eighth lag shows hidden files which are the ones that start with a dot. In this case, the only ones are the shortcuts that we called out earlier. The dot shortcut, for the current directory, and a dot dot shortcut for the parent directory. The sizes of these directories are related to the amount of files in them. To rename or move a file, we use the mv command. To copy a file, we use the cp command, like we mentioned earlier. We've now renamed myfile.txt to emptyfile.txt and created a new copy of the spider.txt file. Each of these commands use the same format. The first parameter is the old file and the second parameter is a new file. Let's look at the contents of our directory now. We see that we now have two copies of our file, we've 192 bytes and the empty file is now called emptyfile.txt. To delete these files, we can use a rm command. We can either go one-by-one or we delete them all together using the star. The star is a placeholder that gets swapped out by the names of all the files in our directory. So our directory is once again empty. Now, let's get rid of it. First, we need to change to the previous directory. We do that using cd dot dot. Again dot-dot is a way we use to identify whatever was the previous directory. All right. Now we can delete the directory using rmdir. This command only works on empty directories so I wouldn't work if we had left any files in it. This time, when calling the ls command, we pass the name of the directory that we want to list and got back an error because the directory didn't exist anymore. Did it ever really exist at all? Really makes you think. Anyway that was a quick overview of some of the commands we have in Linux to operate with files and directories. There are tons of other commands to talk about. But not enough time to talk about them all. We'll mention some of them in the next few videos and put more info about them in Chichi. Makes sure to investigate and practice using all on your own. Remember that reading the documentation, for any given system command, can help you learn more about what it does. On Unix-based systems, this documentation can usually be found in manual or man pages using the man command. Let's keep moving. Up next, we'll talk about a different aspect of the command line interaction. How to redirect IO streams. See you there.