C Programming Tutorial 8 - Intro to UNIX Linux - Part 3

submitted by mkenny400 on 03/19/18 1

This is going to be the last video about Linux. The first thing I wanted to talk about was how to make directories. We make directories like this: mkdir test ls This is easier to remember than some commands because it is literally short for make directory. The next thing I've wanted to talk about is auto completion. The easiest way to explain this would be to create a bunch of directories: mkdir pumpernickel kombucha Now when you type cd p and press tab, it will jump to pumpernickel. If you have two words that start with P, it will go for the only one that matches. mkdir plump Now if you type cd pu and press tab, it will go to plump. If you type cd and press tab, nothing happens. That's because it doesn't know which one you want. If you press tab again, it will display all of the options available to you. The next thing we are going to talk about is echo. Echo is a command that can be used to get things to display in the terminal. This is strictly Linux here so this is different than how we did this in C. When we do it again though, you can see cat shows the same thing. That's because every time we run this command it deletes everything in the file. If we want to append to the end of the file, we need to use two greater than signs. Sometimes commands you can use the less than symbol to get input from a file, we're not going to discuss this but I thought it would be useful to share in case you are interested in researching it. We can also use this greater than symbol to direct other commands. You can see that this displays a ton of stuff at once, so if we have a huge text file we can actually scroll through the content using less. less lsOutput Now you are scrolling using the arrow keys, but how do you get out? You have to use q. The last thing that I have to share is that if you are in the terminal and it seems to break and won't accept any commands, I'm going to give you a fix. For example, try typing in cat by itself and press enter. You can see that it keeps going and going and going. That's because the command is waiting for extra information. Well we don't want to give the terminal extra information. So to get out of this never ending trap, hold control and press c. This is going to come in super handy when you start writing code and write programs that you can't get out of. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! www.patreon.com/calebcurry Subscribe to my newsletter: eepurl.com/-8qtH Donate!: bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: CalebCurry.com Facebook: www.facebook.com/CalebTheVideoMaker Google+: plus.google.com/+CalebTheVideoMaker2 Twitter: twitter.com/calebCurry Amazing Web Hosting - www.dreamhost.com/r.cgi?1487063 (The best web hosting for a cheap price!)

Leave a comment

Be the first to comment

Collections with this video
Email
Message
×
Embed video on a website or blog
Width
px
Height
px
×
Join Huzzaz
Start collecting all your favorite videos
×
Log in
Join Huzzaz

facebook login
×
Retrieve username and password
Name
Enter your email address to retrieve your username and password
(Check your spam folder if you don't find it in your inbox)

×