 Once again, all this week I'm going back to the basics using a bash shell here but most of what I'm going to be teaching will work in most other shells and bash is probably the most common at the current date. And last time, just to review, we did a, let's click on the window here, we learned about the echo command so we can echo hello world. We also learned that you can press the arrow keys up and down to go through your history and you can separate commands with a semicolon and you can get user input using the read command and then giving it the name of a variable. So name would be an example if I hit enter now, it says hello world, doesn't really ask me a question but I can type something and hit enter and then once again I can use the echo command to output the variable and we know it's the variable because it has the dollar sign before it and then the name we gave it up here so we'll hit enter and you can see it printed out the same thing I typed in up here. So that was a quick little review moving on. Let's learn about keeping the screen clean with clear. While writing out a script, you can type in clear in your command or in the shell here and hit enter and that clears your screen for you. You can also and let me just run this again so blah blah blah and then we can, so I'm just hitting up arrow to get back to my previous commands just to get some stuff on the screen here so I can clear it again and as I said you can type the word clear and hit enter and it will clear the screen but if you're actually, and that's great if you're writing a script but if you're actually working in the terminal, in a shell, many times I'm not sure if it's true all the time but it has been every time I've tried doing it in a Unix environment or a Unix-like environment like Linux. You can hit control L and clear that. I wanted to say that because viewers will get mad at me if I don't bring that up. So control L is a shortcut key for clearing the screen or you can just type clear which is what you'd have to do if you want a script to clear which we're going to get into actually writing out scripts later this week. So that's clearing the screen, typing clear or hitting control L. Next thing I wanted to bring up was the new line. So if we use the echo command I can say echo hello and then I can say semi colon and a new command and I'll use the echo command again and I will say world. Now we're echoing hello and then we're echoing world, two separate commands when I hit enter. They're on new lines because by default echo puts a new line character at the end of what it's echoing. You can tell it to not do that if you'd like by adding the dash n option. I'm trying to get the right wording here, switch. They're called different things and they are different things and people kind of overlap them and I do all the time. But basically what I'm trying to say here is basically when this first command is echoing out hello when it's done it's like it's hitting enter to create a new line. But if before we put out between echo and what we're echoing out we put a dash n. We will hit enter and you can see they're on the same line now because this dash n means no new line. Don't put a new line. You also notice that the words are together because we don't have any spaces in there. So if you really wanted to do this you would should put an extra space right there. And now we have hello world. So I mean this is just an example that will be cases where you use this no new line option. This is kind of a weird one because you wouldn't actually do it like this. You would say echo hello world on one command. I do want to say though that if you would do that with the second one now you're going to not have a new line at the end of this one and your prompt is now at the end of it because we never got a new line. So that's why it's all on one line here. If we hit enter again it goes back to normal. So that's removing the new line at the end but let's say you wanted to echo something out with a new line in the middle of it. Well we can do that too with using the backslash and the end within the string that we're echoing. So echo and then I can say hello world and other things I don't know. So if I hit enter now it echoes that out all on one line. Let's say I wanted it to have and other things on a new line but I didn't want to use a second echo command. What I can do is I can come in here and I can do a backslash n and that is the new line character and I will hit enter and oh when using that you need to use the dash e option here so that it recognizes that backslash command. So basically it's saying look for these special characters that are backslashed out because there are other ones in there as well which we might get into in later tutorials. But basically it's saying look for anything with a backslash in the letter and use that as a special character and in this case backslash n we'll say new line. So once again we get the first half of it hello world hello world and then right here it's like hitting enter it's a new line that's what this backslash n is. You don't see the backslash n but you get the new line and then we have and other things on the next line. So don't forget to put that dash e if you wanted to use that. And that's pretty much it for this tutorial let's quickly review. We typed in clear and hit enter to clear the screen or if you're actually working in the terminal like I am right here you can hit control L and we went over echo dash n means no new line so I can say hello and you can see that there was no enter after the word hello here so our command prompt ended up showing up after it enter to get past that. And then we can use the dash e here to look for special characters that are backslashed out so like dash n hello world we'll put the two on different lines kind of like and you can use that multiple times in there I can say hello world and other things you can see that each time you put a new line. So I thank you for watching once again this whole week I'm posting a bunch of very basic shell commands for you to learn because the original ones I did the quality wasn't very good and so I just thought getting back to the basics doing a bit nicer quality a little bit better audio better visual recording so every day this week next week bring it back to our regular tutorials we've been working on video editing from the command line if you like these tutorials and you enjoy them and you want to learn more I have once again hundreds and hundreds of tutorials at my site a whole lot of them are on shell script mostly bash but should work in other shells as well for the most part not everything but mostly and so go there it's films by Chris calm it's Chris with a K there's a link in the description of this video my videos for the most part are broken down into playlists I have a lot of videos and I'm very bad about remembering to put some and so sir some that might be missed in the playlist but for the most part they're all broken down in playlists you can search through them and I just hope you enjoy my tutorials hope you continue watching there should be a annotation if I don't forget to this entire playlist so this whole there should be a playlist for bash or shell script basics I thank you for watching and I hope that you have a great day