Command Line Interface / Linux Terminal for Absolute Beginners | Muhammad Ali Yasin | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Command Line Interface / Linux Terminal for Absolute Beginners

teacher avatar Muhammad Ali Yasin

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

14 Lessons (54m)
    • 1. Introduction to Course

    • 2. Introduction to CLI (Command Line Interface)

    • 3. Writing our first command

    • 4. Navigate system using LS / PWD / CD

    • 5. [Update] how to insert text into txt files

    • 6. How to create new files and folders

    • 7. How to copy and move files

    • 8. How to delete / remove files and folders

    • 9. How to print output using CAT & LESS

    • 10. [update] How to compare two files with diff command

    • 11. Learn about Head and Tail

    • 12. How to search data from inside files

    • 13. How to run multiple commands using PIPE

    • 14. Data Manipulation with CUT and UNIQ commands

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

AOA students,

In this CLI (command line Interface) for absolute beginners course, you will learn how to use the terminal on any Linux or Unix based machines. I'll be using a Windows PC or laptop, do not worry! they'll work the same for all Operating Systems (OS's).

In this course, we will learn what the command line is and why is it useful to us. We'll be learning about how to navigate the filesystem / our Computer, file manipulation, and much more.

If you complete this course by practicing along, by the end of this course, you'll never find this CLI daunting or scary EVER!!!.

Meet Your Teacher

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Introduction to Course: that said, American people, welcome to discourse. In this course, you will be letting the absolute basics off using command line interface or cli In short on Don't worry about the platform because thes commands will work. Seem on Mac OS UNIX, Lennox on although Lynn Express Systems and even Android I'm not joking. You can practice this course on your android. Foon on. All you need to do is download any terminal up from play store on your good to go Windows users also Don't worry, I have you covered. I will provide you with the tools required for practicing along. Now The most important question. Why should you take this course? When we enlist the reasons Number one, you will look like a pro. Just think about it. One who doesn't know cli versus who know cli makes a big difference. You look for number two, you will have more control over your system. Why? Because you will be able to debug stuff which at the normal users can't you will be able to see the things that other normal users can't. You will be able to work with the cloud on because cloud rents on Lenox based system on 90% off the servers in the world run on Linux. So you will be ableto brick with 90% off this systems in the world. Lennix based servers. That is amazing. And lastly, 11 about me. My name is momentarily and I've been teaching face to face on online for more than five years. OK, guys, that was all in this one and all to in the next one. 2. Introduction to CLI (Command Line Interface): it was the people s the American. Welcome to this tutorial. And in this tutorial, we're gonna be learning about. Come on mind. Come on line. Or a shell or Linux terminal or council or Mac OS X terminal. It's same thing if you are using one off those, it's same thing, even if you know about council, right? Like And chrome. If I right click and go into inspection, I have an option to go for the consul. Right. So this council, this council can be considered a command line. So come online is basically a Sofia which accept command and return some output, that's all. And it is basically working directly with the always. So you can basically communicate with the OS. No. If I using Lennox for Mac OS X or even Android, you're safe. But if you're using windows, then you're not safe. You won't actually get a sofa it from out, and that's after is called git bash. So how do you get it? The way to get it is by going to G. I T minus SCM dot com. On over there, you will see that you can download the softer don't move it on your then. Now, after that, what you wanna do is you want Install it on You want to look for something called get back . This is the software which we are talking about. So what you wanna do is open this now, right? Click Basically goto options on change everything like interface. You can change the tax color. You can change the theme venting a lot of things in your So play around with this and I'll see you in the next trail. Bye bye. 3. Writing our first command: That's the them or anything. People, welcome to this tutorial. So let's get started. First of all, we're gonna go or to get bash because I'm using windows. If you are using other Oasis, I don't mind. It's all same. It's just a different or else. Now what we're gonna do is write off first command on. Before we do that, you will see something strange. What is BST for? What is art? What is text top minus and what is ALS? The other thing that is in front of it. Well, the P I steer for is our using it. How do I know if I type Who, Um, I you would see that you get your using him now. Similarly, at the rate means that this user name belongs to the stack. Stop this PC this system and this is Pacific for the gate. So we don't have to worry about this because it's the everything. But the last thing is chilled. Uh, on this Children that is under scape Key is basically referring to our home directory, which we are inside currently. Now, if you're on a known very our home directory is, you can basically go over to your PC on inside. See, Let's go to users on. Let's go to P ay, Esther four. And as you can see it, this is our home directory. So till dam is this home directory, right? No less clear everything by typing C l e a r clear. It will clear our screen. No, that next thing we want to do is write over. Come on. So we're going to write Echo means print on. I'm gonna print what I'm gonna print Coghlan's on you. Make sure that you're writing it as it is. Like dollar sign capital C or Al? Um, N s on the presenter. What do we see? We see columns. Now, if I make my screen small mike this small on, take from these and press up error. As you can see, the columns have decreased. Why? Because it depends on the columns that are available in the screen. Similarly, if I acker out aker the lines which basically means the rose If I make my screen bigger in size now, if I return this command, as you can see, it changes from 10 lines to 16 lines. Basically, lines means the rose now Let's practice a bit. I'm gonna write Echo on. Hello, It French? Hello. I'm gonna write Echo on double court and inside it, I'm gonna ride. Hello. Which basically means I'm using it in the reprogramming. Works like you put the string inside. Double court or single Chorzow Acura Single Court. Hello. Oh, echoing color handle. Clear. Good. Right, you guys, that was over this tutorial. And also in an extra bye bye. 4. Navigate system using LS / PWD / CD: us American people. Welcome back to this story is going to be about ls Then we have pwd unlawfully. We have CD so let's get started. First of all, PWD what's PWD? In small letters? Canopy The beauty This stands for print working dinner tree The working directory is basically the threat to dietary I am in. So till the do you remember Tilda is still the means the pst four directory, right? So my current working directory or currently, the directory I'm working in A C users and P I step forward. So it basically tells me where I am. So it prints my crank location. Cool. Right now that we know this, let's lend the second thing that CD CD's terms for change neither three changed victory. Now, let's suppose I'm gonna change my directory. I know there is a directory inside this directory, so, actually, let's go over to our directory. So see, then we have users on from here. We're gonna go to PSG for now. When I go into the maybe videos director, right? So what I can do is type CD means change directory on type readers. The i D E O's on Make sure you are being case sensitive in here. And basically you're assured that what you're typing is correctly cased like it's not small . TV is not small. It's big, it's I mean, the capital. So as you can see capital we the U. S. On I presente Now, as you can see in here, my location has changed. Right? Let's clear this. No, let's get back to our home directory by typing CD only. Or maybe CD Tilda Sometimes CD Tilda might Ah, actually city level always work, but you can use CD alone and it'll work fine. So clear way are in over that tree. Now the last thing we're going to be learning about ls ls means what falls on folders are in my directory in this directory in this front directory. So what are the files and directories inside? P. I s t for folder again. Let's clear this year pwd so means this is my current directory PST for I'm honest list all the files and our trees which are inside in here. So l s. And as you can see, we have a website in here. And if I go inside my PSG for and go down in here. As you can see, I have up site. Okay. What if I, like ls minus out what's gonna happen? Well, if I write minus l Basically, this is an optional thing. But if I write minus how it will give me detailed information about the fouls, Okay. So as you can see, this is basically who can access the phone. Can other access the phone? Can a guest access? If I can? The owner access of fun and someone. So, for this is the name off the user. You can actually get rid of this by basically typing. Um ls minus G. So l s minus c. You get whole same thing. But the user is not being repeated in her as you can see. So the rest of the information is cooled. So minus three is more preferred from my point of view because I really don't want to see the user again and again. It's the same user I know. But in the situation, very user can be different. Like you might be working in a complex system. It is such a situation. Then you will need minus out rather than minus heat. Okay, we have learned minus l. We have not learned. Minus Gene. No. Let's learn something else. Maybe minus E. But before that, we're gonna change the dietary because it's too quiet in here, so I'm gonna see the on. I'm gonna go to the next stop. No Atlas minus G and C don't have too many files in here. Still too many vials. Let's go to some other folder. So seedy. Basically. I want to change my directory to let me Jack in here. I might find something useful. Ah, OK. Yeah. You have Come on line in here. Come on line. So we're gonna have single court command line. This is the name of the folder. Okay? It doesn't understand what it is because I missed started. Okay, Now, this one. Yeah, we changed to come on line. Clear. Clear. Now we will look for L s or Thai Palace. As you can see, I have two files only. I love this Spolar unless minus out will be actually bringing the whole information about this Mike who can access it and so on. So forth. As you can see, the name is repeated in here. No, What? I'm gonna do is I want to give you some hidden falls. Do you see any heat and falls in here? Actually, let me show you. Let's go to next top Index top. Right. So inside next door might have come online and signed. Come online. We have nothing, Right? So what I would do is ls minus help on minus e on. You can actually type it together as l A. Or you didn't matter. And as you can see, we have to Ah, folders which are hidden. What do I mean? The dot folder basically means the crimped folder on double door folder means the parent folder, which is the deck so colder. Okay, so this is basically these are the basically references to those. But if I if you really tree have and ah, hidden file, it will show you can. But he minus a it will show you the hit involves. Let's continue. Do you remember the ls minus G? Which basically gives us all this information. Ah, or maybe we're gonna go to deck stop cd dot dot Which will take us as remember from here. Citi dot dot will take us to the home directory. So we're now Index. Stop Now What we want to do is ruin. Ah, look at all the ls minus teas. So I have ALS this information in here and this crap has conceits. Crab, I mean its size, but its crap. What you can do is we're gonna write ls minus much minus l or together actual or LH Doesn't matter. And as you can see, it converts it into human readable form like it's one point for media, that's all. Yeah, I understand. This is better, right? No. Let's keep on going. No, Last one is not lost One, actually, but letting this is actually stating that his ears is the way we see order in here, Right? So what I can do is I can press apparel, which will bring me to the lost A type argument. Then I can basically include our arts gonna reverse the order. As you can see, everything is reversed. So, as you can see, at 1.4 comes at top, it's reversing the order, that's all. Now, this is something I didn't want to do, see? But it's a trick. So let's it ls Asterix on. You see the sub folders as felt in the Windows folder You can see what are the folders and files I have on basically the sub folders and folder to I have these things on in Maybe what a weight. Yeah, I have folder this fall a new folder Regions or looks off things in your Let's go to come online and be Remember that inside Come online I have I love cookies on test one don t extra right. I love cookies and test render t exit. So the command which is Allah's Asterix, shows us all the files. All these sub folders and sub files inside the folder makes us does it. Okay, guys, that was old for a district Auriol and also in the extreme, but by 5. [Update] how to insert text into txt files: I said I want even people will come back in this tutorial. We're going to be learning about the redirection. What redirection now will not go into nitty gritty of it? Because it's kind of complex thing. But in simple words, if you want to learn, how can you insert text inside a file? Then this is the true for you. Okay, so there are two ways. Actually, the one way is demonstrates. But the first is the redirection. So first of all, let's check how many fires we have or what files I have. I have loved or txt. I don't actually use this. So cat loved or txt love nor txt on. It's empty, right? So now what happened Do is on insert some text inside it. It's simple. We write echo, then you ride the text. How are you? Then you write the creative and sign then the name of the file Not if I am now cat loved or txt as can see it has how are you? Good. But if you write something else inside it, it will disappear. The previous message will disappear. How are you? And that's question mark. Now if I use cart as you can see, the previous sentences gone. So if you wanna keep the previous sentence as well, this is called a Pending. And if in a performer, friendly, offending No, If you perform the pending, you can basically add the two created in signs on big it. Now, this time you will see both off the alliance. Are there cool, right? Okay, this is one way. This is one way. The other way is you can write Nano Nano lived a txt a second. See By the way, what's this Tea? Excellent. And many txt. If you don't have the file, it will basically create a new file for you. So let's get out. Basically we can type control or command x to get out of here. So control x for me and I'm out How many use txt If I use txt, it learns that there is a file called loved or txt and it will bring me into it in added more. Now here I can add some stuff like, How are you, Brooke? How are you month? How hard you people are? You says stuff on Duh. Let's get out now If want to get out. We can use control to save this file on here. We can press enter and again we can press control axe. But if you want to learn about these, you can keep a learning more problem. Be out. There is another thing as well. You can use vim or V i. B. I will be. I am. I likely I am, because it's more explain. Ary, more descriptive, basically loved her. Txt And this is bad. This is about you don't want to use. This is really hard. Not really hard, but it's hard like, for example, for until I don't tell you, you won't know how to get out of the hair. You don't have anything in here. You can get out like Do I escape? No, it doesn't work. Do I write Quit? No, it doesn't work. What I do know Now I'm gonna get out. Semicolon or colon? I think it's called Colon than Q. You get out. But if you change something inside and you don't want to see if the changes and you want to get out without saving the changes, you know, basically discard the changes. You have to write exclamation mark after the Cube. Okay, If you want to get out on safe stuff and get out, you can write W Q right. W Q. I wanna save all the changes. And I went again. If I press enter in here, I'm out like you guys. That was all for this one. And I'll see you in the next went bye bye. 6. How to create new files and folders: I said, I'm all right thinking people. Welcome back to Dave. You're gonna be learning about M K. Under that is make Barrett tree on another one called Touch means touch. No, it's not about touch. It's actually about creating new far. So maker allows us to create a new Diack. Treat means new folder on Touch announces to create a new file. Okay, so let's get started. First maker I want to make on directory on I have to give it the name. So obviously you give it space. And then the name of the directory. Let's call it Ah, cookies. I love cookies. Everyone was right. And as you can see, it tells me that it has created a directory called Cookies. Let's ls Days on minus Ellis. Or maybe we can just write l l and it will duel the thing that it is supposed to do. Andre, Even a search for cookies. See? Yeah, As you can see in here, we have cookies folder created for us. Awesome. No way. I want to make a subdirectory. What can I do? Basically, to create a subdirectory, you can write I'm killer. I'm creating a dietary because we're creating a subdirectory. It's gonna be inside cookies, obviously on we're gonna college label for Nor reason it's gonna be called level cool. What about if I want to create another folder? Decide? Cookies are inside label. Sorry. So inside label, I'm gonna write nothing. It does that. So let's go and check the have cookies. You have label. We have nothing good. That's actually get rid of these are basically removed. Label from here under actually removed the cookies as well. This to be safe. Now what I wanna do is make old three together. Let's try this. It doesn't do that. But if I use minus p my NSP, it's gonna do them. But it can be anywhere. Had to start when I say at the start means before the name off. The folders minus P in here. Sorry. My SP in here or at the end? Doesn't matter. No. If a first enter as you can see, it accepts it. So if I come in here, I have cookies. I have label. I have nothing. No going to the 2nd 1 The second guys touch touch on inside cookies. I want to create a file called Test door. Txt so test nor txt but fear. I want to make it inside cookies. Right. So, cookies. Let's go back. Let's go over to cookies on. I have a file called test Doughty. Extreme. This is what, uh, touched us. It creates a file for you, that's all. Now, the Touch Command is really famous for one other thing. So let's go to seedy. Let's stop on the inherent. We're gonna go for a command line, CEO. I'm and they come online on. We're gonna clear this now. Let's minus l. As you can see, this was made on 21st off a pro. Right on This is the time. Cool. What I can do is Vic Touch. I can change the time stamp. So it is to sa it is updated to latest. So touch test one three extinct. Okay, No. Unless minus l test one. Txt. As you can see, it was first of April on. This was the time and now it's 24th off. April on. This is the timing makes us okay. I stepped result for this tutorial. And Al see you in the next trip by 7. How to copy and move files: SLM, American people. Welcome back into this tutorial, we're gonna be lending to new commands again. On those commands will be CP on M V. C. P stands for copy and M V stands for move. Okay, so first is CP means on a copy something. So first of all, I'm gonna go to the cookies folder. So let's CD through keys on inside cookies. I'll create a new file call, loved or txt touch. I loved Arctic Sea. Clear again. Now we want to copy They loved or txt two level. So ls we have label in here and I have loved or txt and I'm I'm gonna basically take this on inserted inside in here. And obviously, if I check the label Alice label, I don't have anything except a new folder. Another folder story called Nothing. So coming back. CP, I want a copy. What? Loved? Oh, txt. Okay, so this is the source because we're in cookies in side cookies. There's a file called Loved Her. Txt. I want a copy that on. I want it to be copied toe. This particular destination on the destination is leveled. Slash. Okay, so now if I come back and check the label. As you can see. Love wise. Copy to level. Cool. What I wouldn't do now is I'm gonna clear everything again. I want a copy to farmers. So in this particular folder that's called cookies I have two falls. Right? Ls I have two falls. We have the loved her txt Andy Tester Txt. I'm gonna copy them inside the let's say nothing Folder. So I'm gonna write c p. I'm gonna copy, Loved or txt. Okay, on test dot txt I want Kobe them inside label on some level are folder called Nothing. Okay, inside it on a couple days. So as you can see inside label slash nothing. We have these two falls. Copy. Now, what I want to do is on a copy. These files that are love and txt from the cookies I'm gonna send them or move them to maybe the command line folder on our deck Stop. So I'm going to write MV means I'm moving. What? Actually, let's clear everything first, So I'm moving MV, I'll move one foul at a time. So there are to see what's going on. Or maybe out moved both it same thing. So I'm gonna be moving, loved or txt? Okay? Loved or txt on. I have tester txt. And now what I'm gonna do is I want to basically move them to Dexter. So I'll go one step behind. Basically, I will goto the parent directory on from Parent Directory. The parent director is what? The home directly. Right? So from home directory, I have the desk top directory on inside dext of Doctor. We have the command line directory. Looks strange, right? But this is how it is Soviet percenter. And now everything should be copied to the command line folder. Let's see now, Africans, they ended decks top. Come online folder. I have I love cookies. Loved her. Txt tester Txt and test wonder Txt. So these two removed What moved? Why? If I press ls now in here. As you can see, those two files have moved to the come online folder on there. No more in here. No, there is one last thing that I want. Explain. Let's suppose I have a file called So recreate a file called passenger Door Txt. What I'm gonna do is I'm gonna write something inside it. Nor Todd, Passenger No. 60 on the inside In here. I love passengers. Save it and I'm gonna close it. I want to basically rename the passenger door txt file. So what I'll do is I'll say M v passenger dirty extra in tow. Ah, strange door Txt. Okay, so I basically moved passenger to strange. Now, if I know Pat the passenger not part means look at the passenger. Sorry. Strange as you can see, I love person passenger. Now where is strange? It's their right. No, it's going because it was moved. I only have strained or txt because the passenger door txt was renamed to stranger. Txt. So this is how we rename or files inside Lennox or inside Come online guys. That was all for this tutorial and I'll see in the next tutorial by 8. How to delete / remove files and folders: asylum or anything. People, welcome back in this tutorial, we're gonna be learning. How can we remove our directory? Or a far It's Alaska started. So how can we remove off our It's really is the first of all. Let us look at the files that are available to us. Ls as you can see in here. I have a couple of files available and there is a folder as well. I'm gonna try deleting a file that is test dot txt. So it's really easy. You start with RM means I want to remove something on name of the file and I test 1 40 Now if you press enter, it will delete it if I try again. Unless, as you can see, the test or txt is gone. Cool. Now it can't be recovered. Okay, so it's not in an any trash folder or something. It's going No, let's clear this. Andi, What I wouldn't do right now is I want to delete the tester. Txt this one. But I want to have an option whether I want to delete it or not. That means I'm I get prompted with the message. So to do so RM minus I will basically ask you whether you want to delete the file or not. So the father is test dot txt now, as you can see, it says, But do you want to delete the file? If I press on in here on enter, it will not delete it. As you can see, it's not deleted. But if I go back on a press, why and then hours And as you can see, the tester txt file is gone. So this is one of the things that you can do with this. What about different delete alot files? So let's go inside love and creating Brondello files. Okay, I'm gonna delete all of these so we'll come back one stuff to the parent directory in here . I'm gonna right arm inside love. I wanna delete everything. This Asterix basically means everything. So this is called vile card. So this vile card is basically telling the compiler Sorry. No, the Kampala, the system, the OS that delete everything, did it Everything that is inside love. So having a press enter on if I go inside unless luff you'll see there is nothing inside. Why? Because I have used gastric, so I don't need to specifically specify the names of the fast. It will delete all of them. Good. That's clear This now what if I want to remove the love directory? The Love directory cannot remove it. Yes, you can remove it. That's right. Rm. Ah, love. It says no. You cannot remove it. So to remove what directory you can either use rmd ir to remove the directory by the name. I want to remove this directory. Or there's an alternative that is You use our M minus D. That is I want to remove a directory called Love. But this thing is what seemed so Don't worry, actually. Yeah, it's going. So ls the directory is going clear? No. Last may couple of non increase. I'm kidder. It's clear. Ole on ls on. As you can see, I have a couple of folders in here known to delete all these folders I can write. Rmd, ir, onda Asterix. That's all. I'm gonna delete all the directories, but it is felt to remove these text files. Otherwise everything wasn't removed. So let us ls this because these are test falls? The sorry, These are text founds that these directories are going the test fall remain because they are no directory now there is one thing that you need to remember now. Suppose I have a diner tree. As you can see, we have a file. Can I remove the director? Let's try to move in the directory. As you can see, it says you cannot remove the directory because there is some file access. Therefore, if a file exists inside a folder inside the directory, you cannot remove it. If you want to remove it, make sure the directory is empty. Fair enough, right? But life, regardless of whatever, I would remove everything like everything. Even if there is a part, there is one thing you can do you can write basically Ah RM minus are recursive lee and you want to remove love so anything that is inside love will be removed and Love directory will also be removed. No, if I write ls as you can see, the Love directory is also going on the, uh, the file inside it was also going, so it's going all going, So this is really dangerous. This is very dangerous. You don't want to use this because it deletes everything and you can't basically go to trash folder or something similar. And grab that thing back. That folder back not filed back. It's really dangerous to use. So basically, you wanna be careful, are around this. Or maybe you can do something like this so our M minus are or minds are I space minus I. So this will basically ask you whether you want to delete this file, this file, this file this file. So it will go through all the files and ask you regarding the false which you want to delete and which you don't want to delete. Okay, guys, that was old for this tutorial. And also you in an extremely bye bye. 9. How to print output using CAT & LESS: I said I'm really gonna be. But welcome back today, we're gonna be talking about less on card commands, so let's get started. First of all, both of these commands allow us to read the content off a file. Okay, So if I have a text file, I want to read the content off the text file. I can do so with the less and cart. So let's start with the card command. I'm gonna write the name of the file that is test one dot txt. As you can see, it tells me that the content off text wonder txt is hello world. Similarly, if I use less test wonder txt I can see that the content of the father's hello world. Now, if I want to get out of here, I can press Q to get out cues turns for quit if you need more help, unless while you're unless you can press actual or capital edge and it will show you all the help or you can use L. E S s minus minus help. This will basically take you toe everything that the less has to offer for now I'll cut out of it. But if you need any help like, how can you change falls? How can you search for something? How can you move up and down? Then you can learn all this from less minus minus. Help! Let's quit out of this again and let's carry this. The biggest difference between these two statement is that the less statement basically allows you to read a big fast. So let's first of all, try. Cat cod has birds start dot txt. We have burst or txt file on A It's a big fire, really weak. And as you can see, it's a big file. No, if I scroll up, loads of the content is missing. But if I ever to use, um, lesson here, I would have gotten all the content so little cut even though you can see in big amount of content. But you can't see the full content, you can't read the full find because it has its own limit, whereas less allows you to basically bypassed that limit and enjoy that file or read that fire. No problem. So what I'm gonna do is less birds don't txt Now, As you can see, we are starting from the beginning not So first thing on, I can go up and down by person, pays down or pray age up if I'm gonna never give through pages or page by page. But if I want to never get line by line, I can use the arrow keys like down error or a pero breaks the same on. If I want to search for a particular word, I can use the slash on, for example, cookies. As you can see, it gets me to the cookies area or the section where the cookies is written. Now let's quit out of this by person. Q. Okay, ice. That was all for this tutorial and also in an extra bye bye. 10. [update] How to compare two files with diff command: I said American people, Welcome back in this tutorial, we're gonna be discussing about the def command. So let's get started. And if the if the i f f basically tells us difference between two fouls, Okay, So that I suppose I have 51 in here and I have far too in here on. I want to know the difference between two. So I can basically write this file Wonder txt on. Then we have the file to the autopsy. As you can see, it says that one meas Well, one line on the means delete and zero means zero line. So you really don't want to cure about this? But if you have seen here, and that means change on if you have a in here, that means a pendulum is basically ad. So if you want to make these two farce same, you can actually delete English from the input. If you have the less than sign in here, that means if I want so inside 51 you want to delete English on it's gonna be same eso if you have less than it means for one. If you have created them, that means file too Let's look at 51 by the way, so we can use the cot state went in here File Wonder Txt a nasa Kinsey. It contains English, and as you can see, these two come together. So we have from English to mathematics. And then we have computer to mathematics. So if you need to make them equal, you need to delete this metal. That's what this is telling. You know, there are some things that you need to learn about inside this. If I write minus true, basically, this will tell me if the files are different. If the fights are not different, what would happen? It is not going to tell you. Let's look at it. They're supposed filed. Three Not supposed exactly file tree and file to our equal. If I run this as you can see, it doesn't give me anything because they are equal. Not instead, if I used minus us in here, if they are equal, it will get me signed. It will give me some massive. Okay, so it says there are equal. So they're identical equal sampling. Okay, now. But if they are not identical or there no equal it, give me something? Actually, yes. Ah, and start of this I'm gonna use s that. It gives you the normal answer, which, without s fieldwork. Now last thing is minus y. Basically minus my will show you the two off the vile side by side on. It would show you the difference. So if I use minus y in here, as you can see, it shows you both of file side, West side on. It can basically tell you the difference. Oh, by the way, this is not complete, Right? So actually, let me actually make this sign a bit smaller. So sign out. Sign size. What? The house? No, As a Kinsey. It basically tells you this is different. Sometimes you will get a bar. The part the vertical line alto means the same thing that there is. This is the difference. This is the difference, that's all. OK, ice that was offered this one and healthy in the next one. Bye bye. 11. Learn about Head and Tail: that's American people will come back today. We're gonna be talking about two new commands there is had under his tail on. Obviously, I'm not gonna be talking about the coin. So let's get started with HUD. Hat is a command. Richmond, fetch data for you, which will read data for you from a text file. But there is one condition, but it will only fetch the number off lines you tell it. Or by the fourth 10 lines. Let's try this. First of all, let's go to our come online folder. So in here, I'm gonna be using birds store txt file Had words nor txt? No. If you count them, they are exactly 10 birds printed for us. Why? If you want to print maybe 20 words, what can you do? Well, if you want to print more than, uh, 10 words you can use minus end under the number of words. For example, I need 20 lines or 21st words Avenues 20. And now I get 20 words. Exactly. Now there is one thing. Let's suppose I'm reading two fouls, so I'll be using to files in here. One is Google 10,000 english dot txt and another is Verdes 30 x t Clear now. As you can see, it tells me that from birds they're txt It fetched thes birds or these lines on from Google . 10,000 English. The txt file it. Fetch these words. Okay, now I don't need this. I don't need these indicators. I need a whole list together to do so I can use minus cute so again, But it minus cute. No answer, Kinsey. There is no, uh, indicator that which file is which. It basically gives me in the list itself took a similarly we can use tail in the same way. For example, tail birds door txt will give me last 10 words on if I want to specify the specific number of words or a specific number off lines that I want to see. Basically, I used the minus and notation minus and for a simple 15 vert. Now it gives me 15 words. Similarly, I can use the this on our the Google 10,000 birds start txt. And this will basically bring me the same situation that from verse or txt. It's bringing me these words thes last words because tale brings us the last 10 words by default and if one include minus and we can include minus and and it will bring you as much as you want. Okay. But if you want to get rid of this and you need the whole line, you can use against the minus que the minus que notation on as against Ian here. V have gotten rid off the, um the indicators the names of the files in here. Okay, you guys that was old for distant Auriol and also you in the next trail by 12. How to search data from inside files: a cell. American people, welcome back into this video we're gonna be learning about a statement that's called G R E P. Grab statement. So Okay, grap grab statement allows us to fact some birds from within a file. So, for example, our search for comment inside verged on txt. And you can see we get comments in here. Alright, we get comments. Awesome. So anything like under comment, un commenting uncommitted. It's all inside levered, sir. Txt But you will realize one thing that all of these file don't start with capital enter because ah, grab is case sensitive. So if you wanna make it insensitive to the cases, you can basically use the minus. I again with minus I. Now you will see that it starts it contains okay? It doesn't actually put me anything that starts with this. Oh, maybe we can use another word like love in here. No. So, as you can see, it can give me the small love in here. Small love. It gives me small love on Capitol love as well as lovely. Right, So this is awesome. It doesn't care about the keys, which is good. No, no, I suppose there arises a situation where you are first that you don't need that particular vert. You need everything else. But you don't need that word alone completely. I don't need it. Get rid of it. I need other things except those word so I can do so by crap minus three on the word like love on after that what words to Txt Birds started 60 on advocacy. It gives me everything on every. Remember that we have to lose less for this. But it gives me everything except the word love on. Can we find love in here? I don't think so. Because this very small I can use something called piping here on. I'll use it right now. But later I will explain it to you. For now we have this right So we wanted unless on as urgency I get everything inside less but just called. We want to go for the love, right? So we can go buy piece by bass like peace down And it can take like our five minutes So otherwise we can write the slash and search for govt doesn't find anything. Why? Because that word wasn't including in here. Okay, if that was all for a distant Auriol and I'll see you in the next tutorial. Bye bye 13. How to run multiple commands using PIPE: I said, I'm not even people. Welcome back into these tutorial. We're gonna be leaning about. Pipe. What pipe plumbing? No pipe. Even the pipe is our word. It actually stands for or it actually means a symbol. The this dis vertical symbol is pipe. Okay, this thing is pipe. This has amazing users. So let us look at the first use that it has. I suppose I'm gonna at last this money ls. And now I want take this list and I'm gonna basically use it or seed inside less. Can I see it? If you saw the previous tutorial, you can say yes, we can do so with Ellis, then the pipe. Then less means I'm taking this output inside in here in this whole awkward which Waas brought to us with Alice. So the aqueduct will be brought to us with Alice will be an input for the less statement. So this whole thing will be seen inside less as conceive. You can see you hold this tank inside. Let's page down. Page down. Page. Now on. Cute for quitting. Cool. No, let's make it a bit amazing in here. So let's say I wanna ls means get the list, then I wanna, um maybe sorted sort 100. Maybe I want only the unique names unique. So first thing you see in here is that this is a list. Again, this is a list. This is a text on various. This is ah, folder. Okay. On a very starting. Well, I think it's old off unique from the start. No problem. It'll, um Let's write something else. Let's suppose I only need the 10 values from the top we can use had for that, right? So I can do this, huh? I can use hot in here because this whole thing will become part of had so we can see this. But what do I need? I need only 10 lives, so I can use Just had a Naja Quincy. It gives me the 1st 10 lines less used the tail for lost templars tail for lost 10 lines. Makes sense. Right. So this thing is are putting whole list off there on that whole list off data is going to the sort command eso sort iss working that whole less on then unique is actually picking us . Giving us only the unique data on tail is actually displaying the last 10. Well lost and things from the from the list again. Last names amusing. Let's go to our come online, uh, holder CD. Come online. Clear. Let's see what we can doing here. Cramp lovely inside birds. Dirty XY. You have one. Lovely. Okay, so whatever, love if some bit of words in here Okay. How many are there, by the way? I can use grip cramp minus c then love the old Lowell Can't words The txt on advocacy tells me they are eight low bell birds and list. I'm gonna be using the crab on duh. Maybe I need only 10. So I will use love First of all, and birds Dirty FC. And it will show me all the verse not start with the love and I wouldn't take this crap on . I'm gonna see it inside. What? Maybe I want Actually, I want only the 10 top lines. So me, maybe maybe the last compliance, Teoh. Okay. As you can see, it takes the list. Whole list. What was the whole list? Let me show you the whole list. It only gives me what they lost him. This is a whole list like, Ah, big Listen here. What it does is it only gives me the last 10 ones. So with this, I only get the last 10 words. So, from hold this list, I only need the loss. 10 birds make sense, right? But you guys, that was all for Distrito. Really? If this is confusing, you can always cushion me inside the common section blue and also you in the next year Ill by 14. Data Manipulation with CUT and UNIQ commands: That's American people. Welcome back in this tutorial, we're gonna be learning about the cut statement or cut command. So let's get started. C U T cut again to use this will use our file Carlo Fun. So let's captain log file Lord Father txt And it's gonna be in the under the video. You can download it from there. OK, now we have this file on Africans in here. We have something off Strange data. Now, what I'm gonna do is I want to grab only this data in here. What allows you to do is it allows you to grab heart off data from a line again. So I want to grab this data in here like all all these these these things. Right? So these and statements to do so we're gonna use cut andan minus D minus demons. Dal Amita, which means the separator for us. This is gonna be our separator for this one. This colon in here, but this place can be considered a separate as well. But I'm gonna be using Colon, so holan Okay, then we have minus F minus half means the field. Okay, The column. The colon, This is C o l o and Colon on Thistle is column C o l o um, an acting. So this is our column. Okay, So this is our first column, because this is our separate eso first. Then we have the second. Then we have the third. Okay, so this is our fourth, is it? Let's see, We're gonna use the fourth colon on our final name is low filed or txt log file the txt. And as you can see, a bigot or data cool, right? Yes. Now that we have this data, let's use peace and understand how it it works with space. So I'm gonna write Clear cut minus t has piece on four space. We gonna use the baby from sixth. Yeah, my spaces six to minus F six on Lord Lord. Txt on. As you can see, it only gives me the error and info. But what if I need only the unique rallies? What to do? Well, if you need the unique values on Li like these in Florida, in Florida, in Florida looks creepy. So what you can do is you can use the pipe on right, and you and I Q. What them? Oh, we forgot to sort So what you do issue sort as well this sort first thing on, Then you do the unique on it shows you the unique values. But if you want to see the count of the unique values you can always use the minus e on you will see the count off the unique values. Cool, Right. But if you need to see no new unique values means known duplicate values like and who has lots of duplicates. But x y that's that doesn't have any duplicate. Right? So for that you can use the U. And as you can see, you see only the something that doesn't have any duplicate cool again coming back to our cut statement, which is kind off freaking me out. So six minus. If I write six minus so anything from six till the end will be shown Makes sense right from six till the end. Okay, six Trent. But if I write six toe, maybe, maybe, maybe, maybe a salmon, too. And as can see, I only see the the editor I don't see the adder. And for thing in here, I only see the error which is cool on as a Kinsey, it's Ah, it's It's it's assorted. That's why I'm getting this kind of result. Because I'm using sort statement in here and I'm using minus w. But if I check, take out minus W in here, minus you in here on the use minus C minus C. As you can see, I have to off these on someone's offered. So I have a unique results in here. Cools. Um Now what? Now what now what now? Yes. I want to actually make the spaces disappear on instead of spaces. I knew something like underscore what I can do. What can I do? You can use the minus minus output minus del Amita equals un disco. Now, what will happen is these pieces in here will be filled with the underscore. As you can see via then again, that was old for a district. Auriol on. I'll see in the next one by