Linux Crash Course for Beginners | Imran Afzal | Skillshare

Linux Crash Course for Beginners

Imran Afzal, Systems Manager / Instructor

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
39 Lessons (4h 59m)
    • 1. Syllabus Overview

      3:24
    • 2. Welcome to Saturday

      0:21
    • 3. What is Linux

      3:13
    • 4. What is VirtualBox

      1:52
    • 5. Oracle Virtual Box Installation

      3:32
    • 6. Creating First Virtual Machine

      5:20
    • 7. Linux Distribution

      2:29
    • 8. Linux CentOS Installation

      23:24
    • 9. Download and Install Putty

      2:32
    • 10. Connect Linux via Putty

      5:03
    • 11. Command Prompts and Getting Prompts Back

      3:56
    • 12. Changing password

      4:36
    • 13. Introduction to File System

      5:14
    • 14. FileSystem Navigation Commands

      9:58
    • 15. Directory listing overview

      3:11
    • 16. Creating Files and Directories

      8:47
    • 17. Pipe

      5:09
    • 18. Files and Directory Permissions

      12:57
    • 19. File Ownership Commands

      11:35
    • 20. Adding Text to Files

      12:31
    • 21. Help Commands

      5:02
    • 22. Welcome to Sunday

      0:20
    • 23. File Maintenace Commands

      11:44
    • 24. File Display Commands

      8:16
    • 25. Filter Text Processor Commands

      13:24
    • 26. Finding System Information

      4:39
    • 27. Linux File Editor vi

      14:32
    • 28. User Account Management

      15:01
    • 29. Switch Users and Sudo

      8:43
    • 30. System Utility Commands

      8:48
    • 31. Processes and Jobs

      19:38
    • 32. System Maintenance Commands

      5:02
    • 33. System Monitoring Commands

      9:09
    • 34. Shell Scripting

      3:18
    • 35. Basic Shell Scripts

      12:41
    • 36. Shell history

      5:12
    • 37. Enabling Internet in Linux VM

      3:00
    • 38. Network Files and Commands

      9:25
    • 39. System Updates and Repos

      12:10

About This Class

This course is for someone who needs basic training in Linux, someone who is already in IT and wants to add a new skill.  It is specifically designed for those who have been really busy with their work and don't have enough time.  Now you don't have to stay awake at night or sneak out of your lunch break.  You will learn so many Linux commands in just 2 days.  Sounds unreal?  Well take a look at my syllabus and you see what I will be covering and then ask yourself if it is worth spending a couple of hours for only 2 days:

Saturday – Basic Linux 

  • Understanding of Linux?

  • What is Oracle Virtual Box?   

  • Oracle Virtual Box Installation   

  • Creating virtual machine   

  • Linux Distributions   

  • Linux Installation   

  • Download and install Putty   

  • Connect Linux VM via Putty   

  • Changing Password   

  • Introduction to File System   

  • File system structure description   

  • File system navigation commands   

  • Directory listing overview   

  • Creating Files and Directories   

  • File Permissions (chmod)   

  • File Ownership (chown, chgrp)   

  • Getting Help (man, whatis etc.)   

  • Adding text to file   

  • Pipes ( | )   

  • Quiz, Homework and Handouts  

Sunday – Advance Linux 

  • File Maintenance Commands

  • File Display Commands

  • Filters / Text Processing Commands (cut, sort, grep, awk, uniq, wc)

  • Finding System Information (uname, cat /etc/redhat-release, cat /etc/*rel*, dmidecode)

  • Linux File Editors (vi text editor)

  • User account management

  • Switch users and Sudo access

  • System utility commands (date, uptime, hostname, which, cal, bc etc.)

  • Processes and schedules (systemctl, ps, top, kill, crontab and at)

  • OS Maintenance Commands (shutdown, reboot, halt, init etc.)

  • System Monitoring Commands (top, df, dmesg, iostat 1, netstat, free etc.)   

  • Shell scripting   

  • Basic Shell scripts   

  • Aliases   

  • Command history   

  • Enabling Internet in Linux VM   

  • Network Files and Commands (ping, ifconfig, netstat, tcpdump, networking config files)   

  • System Updates and Repositories (rpm and yum)   

  • System Run Levels   

  • Quiz, Homework and Handouts

Transcripts

1. Syllabus Overview: Okay, so let's see what exactly? Every going to color in these two days. This is going to be a my celeb sober were for our class Learned Lennox on a weekend. So find yourself a beach here and umbrella And, of course, a laptop to get started, cause this is gonna be a fun right? On Saturday. This is reading. We gonna start learning the basic lyrics we will cover. What really limit is we will set up a war show box. We'll find out what award show box is. We'll start creating a virtual machine, and then we will do the installation off our Lennox. Then we'll connect our links machine to the party. What party is will cover that? How we gonna change? Ah, password. A user password, then continued on Saturday will go where the introduction. Introduction of a file system. How the file system structure looks like file system navigation command, which is very important to find out how you could navigate from one path to another. The director listing overview How each call? Um what decline represents when you run ls minus l command creating files and directories. What are the different ways you could create files and Lennox file permissions file ownership, getting helping and you need help in the inside of a Lenox terminal, adding textual fall redirects pipe when you combine two commands together. Or you wanted to change the output of the first command to a different output. Then, of course, followed by quizzes, homework and a lot of hand out for you to read. So that covers for our Saturday Now next day, which is Sunday. We'll go over some ad vast Lennox. This is for someone who gets into, ah, doing some off the system administration tasks, so this will cover the file maintenance commands. How we copy move removed directories, display commands. How hobby view the files. What are the different ways to view it? Phil Throwing and text processing when you review the output off a file, how you could change or manipulate or massage the up put off for file. So finding system information which system you're logged in. This very important for some off the developers or system and mr to find up in the log in with a logging into a switch. Athletics Machineries Lars Machine While Editors. If you want to create Lennox and right to it. So if you want to create a Lennox file and write to it, you would use a V I text editor or text editor user account management. How created users switch user system, utility commands, process and schedules, then followed by its Sunday or its maintenance command system. Monitoring commands to shell. What are the different type of shells? Shell command histories. Then we'll talk about the network related utilities. Like paying if config how we update system repository system, wrong levels and, of course, will end our Sunday are second day with quizzes, homeworks and hand out. Does it seems a lot. Well, it's not really when you actually spend 2 to 3 hours each day, trust me on that. So this is what our course looks like, so I'm sure you're ready and excited about it. 2. Welcome to Saturday: hello and welcome to your first day Saturday. Well, if it's the Saturday is your weekend or if in any other days, your weekend it really doesn't matter, just pick a weekend or any two days to go over this. So today is your first day and we gonna cover basic Lennox administration. 3. What is Linux: What is Lennox? So, of course, um, we are gonna learn, Lennox, but we do want to know what exactly the next is. Links is an operating system. It's just like any other offering system. For example, Microsoft has Windows. Apple has Mac Son, which is now owned by Oracle. They have Solaris running on spark hardware. So Lennox is an operating system, which sits in the middle off your hardware, and the users and the users are the one run the applications. So it's like a middleman or a bridge that takes the commands from users and translate them to hardware to look at this picture. So you see a computer, right? So if it out an operating system, this computer is considered like a dumb terminal. It doesn't do anything. So how does it work? So we have this terminal, which is, of course, a piece of brick. You open the tray off the computer, you insert your CD or DVD in that CD or DVD, has the operating system image sitting on it? Whether it's a windows are better, it's Lennox or whichever Obering system that you are installing. So you boot your computer from that operating system. So once you're booting it up, it goes through the installation process, That installation process gonna ask you a bunch of questions like, how do you want the opening system to be configured? How do you want your display petition? How do you want, how many users you want to have installed and so on. So once the installation is done, then at the end of the insulation, it's gonna ask you to rebuild. You reboot the computer, and it comes up to the welcome screen and say, Welcome to Lennox or welcome toe Windows or whichever the operating system that you're installing. So then you could attach external devices to it for examples, you could attach keyboard to it. You could Attash mouse to it. So you use thes miles and keyboards. You type a certain command certain you juice applications and type them and then you send it to your operating system. Then you operate System takes those commands and forwarded to other hardware or other system peripherals. So some of them are, for example, be a printer. So you if you are running an application, for example, you're running Microsoft Word. Your type it in with your keyboard and then you want to print that document, right? So the operating system will take the document and send it to your printer, and your printer will spit out the document that you want to print or if you are running other programs. For example, you are online. You're checking your email or you are running some online program or even games. So you are using your keyboard or your mouths. You communicating with you. Opening system in the heart operating system complete communicates with your hardware, and that's how it communicates to other devices on the network. 4. What is VirtualBox: what is Oracle Worship Box? And, of course, why do we need to know about worship box? Well, for this course, you do need to install sent OS Linux operating system on your computer, and there are two ways you could insult. One. You could remove the existing operating system that you have on your computer. Or you could install virtual box on top off your existing Windows operating system or Mac, and then you could install sent Oso you This way you won't lose anything. So basically, a virtual box is a free and open source hyper wiser for X 86 computers currently being developed by Oracle Corporation. It insults on your existing Intel array, MD based computers, whether they are running Windows Macklin excess LHarris. It extends the capabilities off your existing computer so that it can run multiple operating systems on one hardware at the same time. Let's see how it works. So you have when the hardware layer and then on top off it, you install the operating system. Of course, it could be anyone. You have that as Windows or Mac, and then you install Oracle Virtual Box. It's just a A program, a software that you installed on your machine like any other software that you would install. Once you have installed Oracle warship box, then you could install the Lennox on it as a separate small version off operating system. You could have windows on it, or you could have Mac on it, said this one. This virtual box allows you to have multiple operating system on the same hardware. 5. Oracle Virtual Box Installation: in this lesson, we will cover the Oracle Horschel Box download, and it's It's insulation. First of all, you would have to go to Google and type Oracle Virtual Box download and then the first link you will see here go to download. If your operating system is Windows, you'll click on Windows Host. Once you click on, it will ask you to save the file. I can't save the file, but since it takes some time, I have already saved the file previously to save some time. This is the file execute herbal file that's been saved. Run, click. Next, Leave everything default setting. Create a start menu entry You. Could you believe that? Create a shortcut on your desktop? That's fine. Create a shortcut in a quick lounge bore. I don't like that and Register File Association. You believe that networking installing the Oracle Worship box and network feature will reset your network adapter connection temporarily. That's fine. Proceed 10 and stole. Do you want to allow the following program to run since installed software years? Would you like to install this device software from Oracle? Yes, if you notice quickly. This created a quick desktop shortcut on your desktop. It is trying to install another device software That's fine. Click Install. Just going to say, Always trust anything that's coming from Oracle Corporation and just click on install. So this week it's not gonna bother me again. And there you go, Oracle be impartial. Box installation is complete. Click start Oracle of Urschel box after the insulation. Yes, you could leave the check box cook finish and is Cancel this man Dairy go! That's the first welcome page off the wardrobe box. And that's where we have actually completed the installation off the warship box from a hair on you could build, create a new wardrobe machine. And once we create a new washing machine, we will install Lennox Santo s operating system on that washing machine. 6. Creating First Virtual Machine: creating virtual machine. In this lesson, we will create our first social machine. And on victory will be installing are sent OS clinics operating system. But worker machine is basically nothing but a shell. Ah, container, which holds the information off a machine CPU memory disc and all the resource is this fortune machine is gonna be sharing. The resource is wherever it is installed. So let's say if it is installed on my laptop, it will be sharing. The resource is from a laptop, the Oracle work show box. I'm gonna open it up. Okay, so this is the window for the Oracle Horschel box. I'm gonna click on new. The name I will pick is my first Lennox, the M. And if you notice, um, the virtual box is smart enough to OPEC, the operatives, his assistant type and version for you. You probably noticed that you are going to see the 64 bit. You are probably seeing 32 big. Now, if you are seeing a 32 bit, then either your computer is 32 bit architecture or the virtualization technology is not enabled. First, let's find out if my computer is 64 or not. So let's go to start menu computer. I'm gonna click right click and go to properties. Once the property comes up, you will see here it will tell you if it's Win seven PC and right here you're gonna see or is this system type? It's a 64 bit operating system. So that's one way. That's one of the reason that when I'm building my worship machine, it is coming up 64 bed operating system. The second reason you might not gonna see it 64 is if you don't have virtual technology enabled in your bias sitting. If that's the case, I have actually pasted an article and in my in this lesson and there is a link to it, I would recommend that you could go that link and try the settings that are recommended and see if it changes the 64 setting. I'm sure it will work. If not, you will always email me back. So I'm gonna leave thes setting sugar click next Now here is gonna ask me the size off the memory I want to assign to this virtual machine. Now, by default is picking up one gig off memory now, you should also keep in mind How much memory do you have actually in your laptop? So in my laptop, I have Let's look at my computer again, Right? Click properties, and you will see here. My computer has installed memory is four gig. So it is. It is wise that I keep the memory below that digit. That number. So I have four gig, so I'm gonna give one gig up that memory to dis virtual machine. I'm click next, create a new Horschel desk. Yes. It will create a brand new Horschel disk. Next, leave the default dynamically allocated. Lee the default post. Um then this is the size of the disc. By default, it picks a gig. I wanted to pick 10 gig just to be safe. So I'm gonna just click inside this box, remove and type 10 and click create. And there you go. This is my first worship machine that is created again. Think off it as a piece of hardware that's been created for me. I'm on the assembly line. I'm putting the CPU and putting the memory and putting the hardest. I'm putting everything in that machine and I built a machine. So once the machine is built, what is the next step? Next step is to install the operating system, and in our course, we will be working with Santo s up a ring system. So I'm gonna power this on, and I'm gonna install the operating system. But of course, before I go ahead and install the offering system, I do need the software ISO image. So in the next lecture, we will cover how we're going to download the IRS. So, software, and then how you could attach that software to this Lennox of'em, and then we will boot off off that software. 7. Linux Distribution: Lennox distribution. I will cover here all the clinics operating system and its flavors that are out there, the main ones and the popular ones. There are many, many of them. But a few of them that I captured here for the 1st 1 is red hat. You probably have heard of red hat from many different sources. Red Hat is an enterprise level operating system that are being used by big major companies . They do charge for the support they do provide their own, um, customized, pre configured build offering system. You cannot change it. It's not open source, and anything goes wrong with the operating system. Red hat can provide the support to fix it. Then the next one, we have a scent operating system which is sent a West. This is the operating system. Actually, we will be working with in my course. Um, and the good thing about learning center was is if you planning to apply for a job on Lenox , um, after the course, or once you gain some experience, or whenever you are ready, you could easily find many jobs in red hat for Santo s. It's exactly the same as Red Hat it has also but managed by red hat. They don't provide support on center was and it's completely free. Then we have fedora. This is also one of the popular operating system that is used by many companies. Again, this one is free. Then we have Soucy. Soucie is very popular Obering system in terms of customization, many people uses a this operating system and they change the code to give their proprietary appliances and their proprietary programs. Um, a lot of companies like being where also run Soucy appliances in the environment. Then we have day be in. Um, David is very popular at the PC level, and the last one is a bun, too. So all of these are major Lennox distributions Lennox operating systems that wanted to highlight. Ah, you will be hearing many of these names down the road, and our focus in this course is sent operating system, which is cento us 8. Linux CentOS Installation: Hello and welcome to sent OS installation. This is the fun part. Yes, this is where we going to get our hands dirty. We gonna go ahead and download the center Will s I s O image file from the from the Internet. Once we have it downloaded, then we will go through the installation. A complete installation off sent OS Lennox operating system. So you ready? So now I want you to go ahead and open up your browser. Any browser that you prefer, whether it's ie, Firefox or chrome. So let's go in. I have my browser open already. Um, I will go into Google now. The second step is you could use Google or any search engine that you like and I want you to type sent os download and hit Enter. Once you hit enter, you will get the first length I want you go and click on it. Or you could simply go and click on download. But first, let's go to this first link. So in the first slink or the first page, you will see download Santo s Now, Sometimes you will see three options in this page. One is a DVD. I s o second one is everything DVD I eso and 3rd 1 is minimal. I s o If you are seeing three or if you're seeing too right now, it doesn't matter because what we need is DVD. I s so this is the one that we need to click on. So go ahead and click on DVD. I So this will bring you to the links where the eyes are. Images are saved. So all those links are actually the links to the servers or they're often time referred to as mirrors. These mirrors, when you click on it, will take you to the file where the file location is. So go ahead and a pick Anyone off your choice over recommend that you pick the 1st 1 So go ahead and click on the 1st 1 Once you click on the 1st 1 it will ask you or prompt you to save the file. You have to save the file. Ah, to you to the locations so going. Click. Okay, if you do not know where the file is being saved, you see this little arrow here? If you are using the, uh, fire walks, he will see this little arrow here. Click on it and it will tell you that it is being downloaded. Right now. I do not want to download because I have already downloaded that file previously because I don't want to waste time, your time and my time to go through the company download. So let's minimize this page. Let's go to a desktop because all my, um, downloads go into my desktop now. You already have this center west. Okay, Now, I want you to go ahead and click on a double click on your Oracle War Troll box. The icon you have on your desktop. If you do not have that icon, your desktop, then you go to start menu and find that up and you will go ahead and start from here. When it opens up, you will see the my first Lennox for Lennox PM. The one recreated earlier. These two You're probably not going to see it because I was playing around with some windows. Were for machine anyway, it's just you could just ignore them. Um, click on the first, my first Linux VM and click on start. Now, this is powering up yours from machine. This is exactly the same way as if you powering on your physical machine, but pressing the button on it. So now it is asking, since this washing machine has no operating system, so by default is asking you to attach award actual disk to it. So it is asking where is the location off that were actual disc, which you want to install that operating system. So go ahead and click on this little icon which will browse us to our desktop where we have our eyes. So image safe. Click on this one, and you will see right here on our desktop folder. When you click on our desktop, you come down and you will see right here say, Santo s seven, which we have downloaded Ah, few minutes ago. So go ahead and click on open and click on start. Ah, by the way, this top thing right here is telling you have option to capture key ward option. Turn on. This will cause the upper virtual machine arm of the capture. You could just go ahead and cancel it. Now it's telling you at this green is selling you. This is a cent or seven installed center or seven. Test this media and installed center a seven, or do the troubleshooting right now by default. Test this media and install center. A seven is selected. You do not want to test this media. Usually this option is picked when you have a DVD install and the reason we do the test because sometimes the DVD have scratches on it. That's why we wanted to go through the test. So since this is I saw image. We don't do that. So go ahead and hit up arrow key on your keyboard and it will select or highlight the top one. It's State installed Cento a seven and now go ahead and hit. Enter It is actually bringing the eyes. So image copying the files that are needed to actually install the operating system so it will go through certain start up processes. It will start up the gui that will allow us to go through the installation off the lyrics Center s are bring system. We will give it a minute for the going to come up. See right here says starting installer one moment and installer. The Gui itself is called Anaconda. This is a name they have given Why? I don't know, But this is the name If you want to keep in mind Um you just remember that anaconda is the Gui tool or degree Viz erred. That will help you to install the Lennox offering system. Now you are under welcome to Cento a seven. Ah, welcome page. What language would you like to use during the installation? Ah, by default English and I'm in the United States. I'll pick English United States if you are in any other country. Ah, we recommend is you pick that country or if you want to pick a different language, you could pick that. However, I am not going to tell you how you could go through the installation with different language anyway, So I support for that. You stay on English and then you definitely you could pick a different country. Now go ahead and click on. Continue at the bottom. Right. Okay, so now it says, please complete items mark with this action. This icon before continue to the next step. Now the date and time is the 1st 1 we have already pre selected America's New York Time zone. If you wanted to change the time zone, depending on which times of your and go ahead and click on it and change the time zone keyboard by default. It selects English and U S um language support a gain. English United States installation Source. Local media, Which means that we are installing the operating system through the local Aiso image, so it's already been selected. Perfect. Next stop software selection. This is where it has by default the software selection as minimal install. If you leave that as is minimal installed, then it will install the lyrics operating system, but it will not have any gooey on it. Well, remember one thing most of the time. Incorporate Marmon. There are no gooey on Lennox, but since we are going through some practice, we will go through some GUI practices as well, because I do want you to know how Gui works in Lenox as well. So we'll go ahead and click on software selection, and that's where we will pick um, a couple of different additional software that are required in the middle installed. Ah, we have other options as well. If you want to use system administration tools are any other tools you could pick them. We could leave as default. Compute nodes, anything. Any debugging tools, directory clients, hardware monitoring tools, development tools. Most of these tools are used by developers. Since we are not going through the development training, we we will leave that. As is infrastructure server. Ah. What type off server are we going to run on this machine? I will tell you you could pick, um, anyone that you think you might need it later on. Um, you could pick the d n a server for now because we are going to core DNs, which is bind in this training so you could pick DNS if you do not pick Deanna Sarah this time, there is no issue. We could always insult the in a server or package later on, but anyway, just to show you how it works, I just selected one DNs name server. Anything else that you want to select here? You could. If you don't want to just follow my lead, then let's go to the next one says file and print server. You could leave everything as is a said basic Web server. You don't need it. Work authorization hosts and no several with Cool. Yes. This is where we have to come in. And if you notice as you are going down, all the other options that were available on the base environments are actually added here as well. So don't worry about it. They're repetitive. It's not that this option will have a different d n a server and with this based environment. So right now we are in the server with Gui Environment. I want you to go down and pick um que d e which is Katie easa. Plasma workspace are highly conferred with graphical user interface. I also want you to pick Java platform because if you are running certain application that requires Yaba, we could bring that up. Um, that see what we have? You have all the virtualization tool. Um, okay, I think we are good hair, but the Katie eat now The next one is genome desktop now Genome desktop are the ah, the desktop that also per wide some type of applications. Um, for the user, let's say if you want to use Firefox or if you want to use, um calculators or something on the gooey side, then you could select this. That stop as well. So go ahead and click on genome applications. Um, any other tools we need Internet application, email, chat, video conferencing software. We don't want that because most likely incorporate environment. You will not be using any of thes Katie plasma workstation workspaces development and creative workstation, and that's pretty much it. You don't really need any other applications or add ons for the selective environment. Now go ahead and click. Done. Now you will see this option right here. It will tell you checking software dependency. It means it is going toe our ISA image and asking that isa image. Hey, this user has selected thes these many packages. Do you have these packages for me to install on this harboring system is going to say, Hey, okay, no problem. Let me go ahead and check that. So it's checking the source, and it's checking the software dependency as well. So what is needed for those add ons that we need to install installation destination while it's running will go to the next one. It's his installation destination now. How do we want to protection our disk and solution destination right now? Says automatic partitioning selected If you want to change that? Meaning Right now, we have 10 gig. This is the discus size that we selected when we were creating the worship machine. This this size has shown up here is telling us we have 10 gig of disk space. How do you want to partition it? We're telling it automatically configure the partitioning if you know, or if your organization has a requirement to partition a disk into different slices or different partitioning than you will go ahead and click on. I will configure, Petitioning. Now, go ahead and click on. Done. Next one is K dump. Que dump is enabled If something goes wrong, K means Colonel, if there is something wrong with your system Ah, Colonel is going to write some messages, um, logs that is often referred in Lenox language as a dump that is enabled. So it's always a good practice to leave that enabled. So this way, if you are troubleshooting with your vendor, let's say if you have cento us red hat involved, they could go at and take a look at your logs. Next one we have is networking and host name. Okay, you We are on a network and host name configuration. At the bottom, you'll see Host name. Go ahead and highlight what we have right now and hit, delete and type in the host name off. The Lennox operating system will type the same one as we picked for R V M my first Lennox VM and click on Apply as soon as you click on apply. You'll see the current host name was changed to the host name that you have picked. Now the second thing is to configure the even it. Now, remember, by default if your machine or the washing machine, this is your washing machine. If it is running on a PC that has one gig, often network port, it will show up here as beat one gig, and right now it is showing its wired for me because I have selected or I are my machine where I'm running this worship machine is wired, so go ahead and click on configure and by default it will show up The tab as Ethan at E E and P zero s three is the name off our network adapter. So we'll click on General and we click automatically connect to this network when it is available that arrest of this setting is blacked out by default. You could leave as default I PV before setting is the setting for automatic DCP. If you want to assign an I P, then you would have to change it to manual. But we want the I P to be assigned automatically. So if you leave it as is I'm the last one is i pp six settings. We don't use that right now, so go ahead and click on safe. So once you click on save, you will see its tells you automatically connected. It is given an I. P Already. And now you could go ahead and click on Done. Okay. And so our network and host name has been configured. Now, the last part is security profile. No profile is selected. You believe that as as unless your organization has a specific procedure to put in place for security policies, then you could define it here. But for now, you could just leave as is, and go ahead and click on begin installation. Once you click on begin installation, you will see at the bottom. It will start creating your your partitions. That were selected that you ask the system to select it for you. Now it's going to starting package installation process. While this is going through the package installation, we have to, um, uses settings to define. First is root password. So go ahead and click on root. Password is not set. And here you would have to put in the root password. Pick anything that you you will remember if you notice I picked a week Password. You should pick a strong password if you are, Um, if you're working for a company or for you or an organization, But if you are just following my lab or you're doing this everything as a tutorial, that is fine. You could pick a week password. However, if you notice at the bottom it says the password you have provided it is weak. The password fails. The directory check. It is based on a direction dictionary word which you will have to press done twice to confirm. So okay, I understand it is a weak password. In order for me to keep that password, I have to press it done twice. One to now it has taken that weak passwords, user creation Let's go ahead and create our first user. Full name. Let's put in our first name by default. Lennox takes the first name as the first letter. First initial last name is complete. Last name. So for me, the user name will be I of soul. Keep your user name shorter than 32 characters and you do not use spaces. That is fine. We are not using any spaces were wholly using six letters. Make this user administrator. You could lead that out. Requires a password to use this account. Yes, the pickup password. Again. It is weak. I understand. And I would have to do the same thing Done twice. Okay, it is done. Now if you come down and you notice right here it The operating system is installing or this Viz erred is installing packages for this offering system. Total number of packages that are required to be installed are 1397. You might have a little more or a little less, but that's okay. It depends and it changes over time. What other packages are installed? Water. The dependencies aren't still so again, If your packages do not match with my packages do not panic. You are. Okay, so now you'll see it is going through the packages installation. At this point, it is. It has installed almost 400 packages and they're still about ah 6 to 800 packages that needs to be installed. And this process will take. I would say somewhere between 10 minutes to 30 minutes, I am going to fast forward this entire process to save time. Now the packages installation has been completed. Now it is going to some post insulation set up. All right. Finally, our installation has been completed successfully. Now Santo s is now successfully installed and ready for you to use. Go head and reboot to starve using it. Click on Reboot West. Since the system comes back online, it will give you the initial set up page. The first page is about licensing. You have to accept the license. Click Accept license every hman click on done network and host name if you notice. We have already selected this network and host name configuration during our installation so that you don't need to do it again. Click done. And right here says finished configuration. Go ahead and click on finish configuration. All right. Finally, our entire Lennox installation has completed. Now we have to log in the first time, Click on your name or you could also log in as root. If if you remember, you have picked the root password, you would have to click on, not listed and type and using him crude and password. But for now, we'll go in as ourselves and we will put in a password, click on Sign in or had enter. All right, this is the desktop. This is how it looks like in Cento as it is very similar to Red Hat Cento s. You have these icons right here. You can resize them if you want to. You could delete any I conjugal create icon. Um and you could explore other things on the application and spaces. So also, one more thing when it starts up, it also gave you this welcome page. So you just leave as English. Go ahead and click on next typing. If you want to change anything you believe a default location services, I usually keep it off. If you want to leave it on, it's really up to you. Click next connect to online accounts. You don't have to do that clicked, skip, and then start using sent Os Lennox. So once again, congratulations. So now you know how to do the complete Lynn accent OAS installation? If you think that you missed something that I would recommend you to go ahead and delete this entire Lennox, we m and go ahead and create a new washing machine. And do the Lennox insulation again from scratch. The more you do, the more practice you'll do, the more you will learn. All right. Good luck. 9. Download and Install Putty: in this lesson we want We want to cover quickly how we can download and install Putty, which is a terminal client to connect to the lyrics machine. So this is how the party looks. So let's look at how we could download it First will go into our, um, the browser Open up a google, and we'll just simply type download hurdy. The first link you get put he dot org's click on it, and the first thing done will put it right here. Click and then you're gonna get to dot M s. I, um, files. Thes files are used on the vendors machine. So if you have in just 32 bit, you don't know this one. Or if you have 64 bet you go down with this one. I have 64 so I'm gonna download this one. It will save the file to your desktop or wherever you have the location on their your brows are set to All right. Download is complete. It should be on my desktop. It's right here. I'm gonna double click Run next. Leave the default next. Here. It will have add shortcut to party on the desktop. I want the shortcut. The party and will be in Seoul on the local hydro. Yes, click install. Okay, The last screen is gonna ask you to view the read me file. You don't have to. If you want to believe a checked on and then click finish what's in Finnish. You go to your desktop, you're going to see this putty shortcut created on your desktop so you could just simply double click. And this is the party client that you have. So we're gonna put in the I P address and the porters already set to 22 then we'll connect well in its machine. But first, we need to find out what is the i p at the Lenox machine. So let's look at that in our next lesson. 10. Connect Linux via Putty: here we will access our length machine, the one we install earlier to our party client. Now, remember you could you have access to our livings machine You could use to party client Or you could simply log and directly to the consul. It's really up to you. So this is the party client. Looks like we're gonna connect to our lyrics machine, which is our first length machine. Ah, through the putty. Let's go to our Lennox machine. Here we have our lyrics machine and that's a consul. We log into the council and then we open up a terminal And that's how we perform most of our task, most for commands. Now, another way to connect is through the putty. Ah, for that we have to assign an I P address to this links machine. So what is Sally Pierre just right now? The commander check is if config so in this call up. You see, here are network adapter. Is this e and P 00 s three, but it doesn't have an I p address. So how do we assign an I P address which we will go into our Oracle virtual box click on setting and go to no work changed in that to host only adapter and click OK, once it is saved because simply one If config command again and then you scroll up and you will see right now it's still does not have the Ethernet I p address right here. It should come up somewhere here, so I think probably the adapter is not up. So we will have to become route and type in command if see, if g so if up. And the name off the adapter, which is E and P zero s three. Once you hit that, it's his connection Successfully activated. Let's wait for the prompt. The prompt came back. Hit up arrow key And look for if config again. And this time you see, it has an I P. Address, which is 1 90 to 1 68 56 101 Now we gonna put in that I p address in a pretty terminal 1 90 to 1 68 the 56 1 a one hit enter. Or you could also save the session saying my Lennox, um, the m like that you could save it this way next time you don't have to type in the i P address. And then you click hair and then click open once it opens. Getting asked you for warning. Sign It is going to tell you if you wanted to keep the ssh keys, it's just await secure wave to connect to Lennox. Just click. Yes, it's gonna say log. And as I'm logging as myself, I so and you probably have your own accounts. A log in with your own account hit enter in the past work. And there you go. This is exactly as if you were logging in through the gooey. Now, the reason we need to know how to log in through the putty is because 98% of the time when you are gonna be working in a corporate environment, there is no gui environment where you're gonna come in and log into the gooey. You always gonna have the putty session where you're gonna put an I P address off the destination server and then you're gonna connect to it. Now, if you type host name, you're going to see your host name right here. So this exactly as this one right here. So in our lessons down after all these after this lesson, we're gonna be using interchangeably. Sometimes you're gonna be using putty. Sometimes you're gonna be logging in as the consul. So it really doesn't matter where we logging in from, But you should know both ways how to log it. 11. Command Prompts and Getting Prompts Back: Hello, everyone. Before we get on to module three, there's something important I wanted to talk about. And that is command prompt and how we could get a command prompt back if it gets stuck. So what is a command prompt? Command prompt. Also referred to simply as a prompt is a short text at the start of the command line, followed by prompt symbol on a command line interface. So if you have your linens machine and you have your gooey and you open up your terminal, it will look like this. And if you notice in this terminal window you have this route at my first links VM and then , um, close brackets and hash sign. So the first part off this entire command prompt is the user name route. The second port is the host name, and the third part is the prompt symbol. Now, depending on which system you're logged in, as in Lenox, most of the leading systems will show up the command prompt, like of this. But maybe there are certain letting systems that are configured differently, where you will not see use a name or horse name or a different prompt symbol. But by default. When you install Lennox, this is how the prompt will look like when you see the symbol, the problem symbol. You see the hash tag hashtag means that you are logged in as root. If you're logged in anyone else but route, then you will see a dollar symbol again. This can be reconfigured. Or you could change a symbol as well, Which is which can be done at your profile level anyway, So you have the prompt. Now, if you get stuck at certain command and you don't get your problem back, you could simply type controlled, see on your terminal to get your prom back. Now, let me quickly go into my Lennox machine and I will show you how the prom looks like. So this is the prompt. If you are logged into your Lennox Consul, you install that you logged in. You right click on your desktop. It will open up the terminal again. This part here looks like it's a user name and this is the host name. You can also get the using them by typing who a mile? Sure, you're logged in his route. You could type host name and I'll show you the name off your machine again. This is something that I will definitely cover in the little lecture. But I'm just showing how the problem looks like. And as since I'm route, I have a default prompt off hashtag now getting the prompt back. Meaning every time you need to run the command, you have to have this prompt back. So if you do not have that prompt back, you cannot run a command. So if you're stuck at certain point, let's say if you are trying to run a command, a command, that's a cat again, which will something we'll cover later. You're doing cat and you're doing and you just accidentally hit Enter. You see, it's your commander stuck. Now, every anything you type here is not gonna works. You have to get that prom back to get that prompt back. You have to type control, See, just like that. If you're running another command, that's a top. And it is giving you some information on the screen at Riel time. If you want to get out of this and get your prompt back type control, See again, just like that, if you want to use another command, Let's say less minus l, um, to let's say pipe it and you see it's giving you this, um, redirect sign thing. It means it's also stuck. That means your command was not fully executed. So in order to get your prom back again, type controlled. See? So this lecture is all about command Prompt. If you are stuck anywhere and you do not have your prom back type controlled, see to get your prom back. 12. Changing password: changing password in this lesson, we will co of how do you could change the user password? Either you are route and you force the user to change the past from in the first time you log in or if you you're just yourself and you want to change your own password, you should change your initial password as soon as you log in. Now, this is when your account is created for the first time in the system and you log in with a password that's been given to you. Or sometimes what happened is a password is not given to you. You would just long in with your user name, and it will automatically prompt you to put in a new password to change a password. The command is password followed by the user. I d. The password is not the entire work. It's just p a s s W d. It does not have all an r in it. So it's password space, use variety and user. I d in my case is I have solved and you hit Enter. It will ask you for your old password or your existing password that you have. You provide that password. The next thing it will ask you is to put in your news password. You input your new password, it will reconfirm the new password for it. So I will ask you re type your new password. The reasoning to ask for the second time is because if you have made a mistake in your earlier entry of adding new password, it will match to confirm that you have added the right password. Now, if you just type p a s s w d while you are route, remember, it will change your cruel password if you type he s w d followed by user I d. Then it will change the password off the user. So let's log into our Lennox machine through council and see how he could change are just a passport. Here we have our legs Machine council just to a right click and open the terminal. I always like to make this terminal little baker make the window a little bigger. I could just simply drag and drop or go simply back symbolized by clicking here. Anyone? Let's get into our changing password. So when I type password well, by my user, I D it say's Onley route can specify a user name, so only Root has a right to specify the user name. I'm not rude. I'm being myself. Who am I? Who am I on myself? So all I would do is just put it, just password command, not to use any of a tent better. And now it's asking me to change or to provide my current password. So I'm gonna put in my password now. It's asking me for a new password. Remember, I'm not putting this. I'm just gonna put it 1234 and let's say what it says. It says the password is sure than eight characters. So let's put in 12345678 And it says password fears that the dictionary check. So now UNIX are most of the operating system nowadays. Have this check where it looks for a dictionary and see if that password exists off. See if that word exists or not. So make sure you change. You change the password to something that does not go with addiction. I'm gonna change it to something different. There you go. See? It took it and reconfirm it and password authentication tokens updated successfully. So that's this command to change the password. And I want you to try that command. Try come up different types different, different ways become route and change your password by typing password. Um, I have solved Jews name and then log in as yourself. Try that command. 13. Introduction to File System: Lennox file system. Now, what is a file system? A file system is basically think off as a closet as a shelf. Um, when you command you change. You put your T shirts and one shell if you put your socks in another. So there is a systematic way in your closet where you put all your stuff. The file system in an operating system works exactly the same. Opening system has filed system where command files go to a different folder. Peripheral devices of files goto a different folder. All the programs and applications that you install goto a different folders so it will be easier, much easier for operating system to access those files now operating system sores data on a disk drives using a structure called file system, consisting off files, directories and information needed to access and locate them. There are many different type of file system in general, improvements have been made to file system with new releases off operating system, and each new file system has been given a different name. In Lennox, we have file system called Extension three, Extension four X fs, and in Windows, it's the file system called N T. fs our fat legs file system stores information in high, rocky off directories and files. Meaning there is a first folder one folder which is slash a root file system and every other file recreated within the first file or directory. The file system structure in Lenox actually looks like this. As I mentioned, the first file system was first folder. Always start with slash, which is also referred to as root. Now, please keep in mind. Slash route is not as just. Slash Slash is the first directory structure where you have to start your navigating your file system and then underneath it has different folders. As you could see, it has been booed every sector. So this is the the way Lennox structure its file system. Or if you compare this Lennox file system with windows, you will see the Windows has also something like that similar structure. But they have given a different name. So let's look at the Windows file system. If you go to start and you go to computer, you're going to see your C drive. In this case are see, Dr when we refer to our file system structure diagram in the background you'll see right here. This one has slash. So in vendor, it starts with C soc or slash is the same. But seeing Windows and Slash and Lennox. So when you double click on windows, see, Dr, you're gonna see all those different folders. Now, why do we have all those different fold? Why not just one folders? And it will be so hard for the operating system to find the right file or directors that you're looking for. So, for example, like APS and Del, then you have Intel folder. All the intelligence chip related files are in that directory. The Logs program files program files are the folder, and you install 1/3 party applications. That's where they are. Download all the files get, then we have another one program files X 86. That's where the 32 bit related directories are created and users that are the user directories. If you click on it, you'll see my director right here as well. And then, of course, the windows, anything that related toe windows. So that's why it is pre defined by Windows that every time we create a file or over every time we install a program automatically, it gets installed into these files in directories. So just like that, and become here you'll see here that this is the file system the same way in Lenox, this file system is created. But of course, the naming convention is different. Now let's take a look at our legs file system. So I'm gonna open up Oracle Virtual box. So let's go to the file system says it said in the linen file system, it starts with the route. So when you do CD slash, which is root slash hit enter and then you do ls minus. L Here you have a list of all the directories and for house that are starting with slash. You could go into each of these directories and you could see how the file system is structured. So I hope you guys got the just off how the file system looks like. And why do we have file system in our operating system? 14. FileSystem Navigation Commands: navigating to file system. Of course, Now you know a lot of bottom file system. Now we need to know how are we going to get into the file system? What are those commands that we really need to learn to actually go from one directory, toe another, get their file contents and find out which directory were en when navigating a UNIX file system? There are few important commands. Again, The number one command is CD, which stands for change Directory tech and 2nd 1 is P W D, which is print working directory, which tells you Wish Director you are currently in and the 3rd 1 is L S, which stands for listing, which lists the contents off your directory or folder. CD Stands for Change Directory. P D stands for Pet Working Directory and Ellis stand for list. Now let's look at the rial example. I'm going to start with Windows because the reason I compare windows and then it's all the time is because it will be a lot easier for everyone of you to really understand the concept behind it, because we actually work on windows almost every day and the scroll through everything and we clicked through everything and we don't really realize how experts we have become. So if you really need to know Lennox, you there should be some comparison with Windows that I will be doing. So let's look, at example off windows. Okay, So I have to see Dr Which in Lennox is What is the C drive for Lennox is slash. When I wanted to go into this a C drive, I will just do double click and the folder comes up. And when I wanted to go into program files all to double click and the folders comes up and so on. And if I want to go into windows actually, I'll just double click in Lenox. Let's go to Lennox Machine. Remember, our next machine? The first thing I want you to do, of course, has become route. Meaning you are as yourself right now. How do how do you know you are yourself? Is because first you see here on your prop, you'll see Name. If you just still wanted to know your name, you could just type Who am I And you will see your user name you When you become route, you have to type s U which means switch user and just dash enter Put in your password. Okay, So you have this message that would tell you the last time you became route was the state this time and so on. Anyway, um, let's do clear as clear is so only gonna clear the screen. I just want to make this a little bigger, so it would be easier to see. Okay, So now when you are in a directory, how do you know where you are in windows? You could tell right? You could tell you are in computer. Local drive in, Windows writes up right here. But analytics, you don't know. So the command that you gonna need is PWD. This is what's going to tell you that you are in this directory. If you wanted to go into a different directory, let's say you want to go to slash, which is slash Flash is the primary or the parent directory of all the directories. So you type C d. Which stands for again change directory space slash you hit. Enter Once you hit. Enter. How do you know you are in that directory again? You type pwd and it will tell you you are in slash directory now what's inside of this directory? We need to see that in order to see that you have to type LS option l. And everyone tells you all the listings off the directory and folders and files that are inside off this directory in linen and windows. When you are my computer, you double clicking on a folder. Let's say you're clicking on program files around, Um, and you click on any other folder. Let's say Del So you notice you just double clicking it and it is taking you to the directory in Lenox. Udo have that you you don't have clicking. So what you need to do is you need to do CD so you are already what director you're in. You are in route, and let's say if you want to go to a directory, call Ah, that's a boot. So seedy B 00 t boot and there's you are you are in boot. Now let's say in this example you want Come here. You already see the listing off. What's inside? How do we know the listing in Lenox? Well, you have to run a command. It's not that easy. There you go. It tells you this is what you have inside. By the way, some of the lines are chopped up a little, so I'm just gonna make this a little more bigger. Look, So you're going to see anything that stores with Dash right here? It means it's a file. Anything that starts with D, it means it's a directory or a folder. I wanted to go back to my root directory, but before I go back, I wanted to know where I am. Commanders PWD. We are in boot and I want to go to a slash route again. There two ways you could do you could do either CD slash and we'll take you to slash directory or you could do CD dot dot which is will take you one step back. One directory back in windows. How do you do that? And windows? You could simply just do backs flat. Uh, you could simply press the back button back button. And there you go. You have all that also, and windows. You notice you are when you double click. Once it is doing three things for you, you double click wants that is doing CD for you, then automatically it's listing all the directors insights it's doing ls for you already and now how do you know which director you are in right here on top? That's how it tells you. Restrict you in So it's in windows. You're doing three things in one shot in minutes. You actually have to Jews all three commands one by one to see the same thing as you wanted to see in windows. So let's say if I'm in if I wanted to go in etc. And I wanted to go into another directory which is at sea sis config. So I am to directors in How do I know PWD Working directory? It tells you in Etc. Sis config. Now if I wanted to go back to Etc directory what I would do cd dot dot and confirm If you weren't at sea directory you do PWD and the Eagle. What If you want to go one step back again cd dot dot and where you are You are en route. They go. What happened if you just type CD and hit enter Okay, It did work because we got a problem back We didn't get any error. But which tractor? Off again? We are in. Let's check. We are in slash route. Why? Because we are who we are. Who am I? We are route. We are logged in as root and root directory is slash fruit. So everyone this three first three commands that you really need to learn in order to navigate the file system without the still commands. You can not do anything. Lennix. So what other three commands really quickly? 1st 1 is CD. Let's go to home. Let's see what's inside the home. This type ls minus. L you forgot wish Director, you are in this type Pwd. You are in home. If you want to go to a different record, let's say you want to Goto Um I want to see what's inside off slash So I will type slash and what's inside of its Ellis? My cell, These other directors. I wanted to go into each of these directories and final. What's inside of let's see, you want to go to war? Uh, enter what's inside of the war? These are these directories, different type of direction. I want to go to ah fire all a log directory right here. So I'll do CD log. What's inside of log? I have to do. Well, it's my cell again. These are the files and directories inside. Off locked Victory. Okay. All right. I forgot where I am. Where I am. PWD Warlock Art. I want to go back to slash directory. You could do dot dot then dot out again. Or you could just do simply CD slash. And now where you are, you are in slash. All right, so this concludes our lesson. And I hope you have pretty much a very good idea about CD l s and P W D. Commands as a whole. Work of a strongly recommend you to log into your Lennix machine. Go two cd slash. Then unless my cell and I want you to go into each of thes directories one by one subdirectories, come back to from a directory, find out the listing off the directory, and then you will find out exactly how to navigate the system. 15. Directory listing overview: in this lesson. We're gonna cover the directly listing attributes when you do Ellis within a directory to use CD into a directory, and you do ls and you're gonna only see the directories inside. But when you do ls minus l or lt are other options. Within that the A list command, you're going to see different fields that's gonna up on your screen. The first field is the type off the file. So if any file that begins with D it is a directory, any father begins with L. It's a link, and any file that does not have anything on it. It's just a regular file. So the first few tells you about the type The second field tells you about the number of links. It has a heart links that attached to the directory. The 3rd 1 It tells you the owner of the director who owns it, that the fourth, the 4th 1 tells you the group off the directory. Which group owns the directory and then the size off the directory or file the month, the day, the time and the name. So these are the basic attributes When you do ls minus. L Let's go to our Lennox server and see how it looks in our living server by click Open terminal. Okay, where's directory? Are you end that stupid W d and I am in my directory. So let's go to slash home directory. Sorry slash Uh, just last doctor, which is the parent, and then we'll do ls minus. L. Here you'll see the first again. The first column right here tells you what type of file. Otis 2nd 1 How many links? Who nerve group, owner, the size, the month date time and the name. So this is what you should need to know whenever you're doing. Ellis. Because if you are trying to do CD to Ah, Fire, let's save you. Have this while test foil. If you do test. If you're trying to get into this file, it would tell you it's not a directory because it's a file. That's how you should know whether you are able to get into a file or are not. If you go into let's a CD slash user there you go. You are in slash user directory because it's a directory. So that's how you find out whether a file is the directory or link or just a regular file 16. Creating Files and Directories: creating files and directories in this lesson view will color how we could create files and directories different ways to create files. The 1st 1 is the touch. The Touch Command creates a file that is, of course, an empty file. The second way to create a file is if you are copping an existing file and creating a new fall at the destination location and the third way to create a file is through V. I, command of EI is our editor, which really people cover in detail later in the lessons. But I will cover quickly how we could create ah file using V I creating directories. The easiest way to create directory in the command is M. K D. I. R. Bridges make directory. So now let's get into our Lennox machine and we will use every command listed here as a practice to create our files. Okay, the first thing we have to do is to find out what user I DVR logged in. As so you do. Who am I ever tell you? You are logged in as yourself And then the second thing, you have to know which director you are in and I am in my home directory. Now I have I will be creating ah, few files and as your whole work. I want you to create those files and directories as well. The first way to create a file. Here's here. I have a list off ours that I will be creating. We will use the first command to create a file. Will be touch. Okay. Touch space I have here Jerry had enter. When you hit enter and you get the prom back. That means your command worked. Now, how do we know? Where is that file? You do, Ellis minus l and you'll see here the directory you have is right here, Jerry. Sorry that not directly the file. Now, I want you to create another file. Touch Cramer again. Check if it's created. Yes, it is created Jerry and Cramer. Now, I used the option ls minus. L, which will list all the falls under directories in alphabetical order. If you wanted to list all the files or directories that are created, it it was last modified. You will use ls minus lt. Or which means give you everything by the timely water and in reverse, meaning the oldest, one of the top and the newest one at the bottom. When you hit enter, you'll see Jerry was the 1st 1 that was created, followed by the Kramer. Next one we're creating is George. How do you verify that file was created? You do, Ellis l Now these files can be changed or renamed removed, but we'll go to the next set of files to create. Uh, I want you to use this time to copy command. So I want to use copy Jerry, and then the destination file. I want you to be Lex. Dual assman sell to your So what exactly did it copied this Jerry Fall and named it Lex? I want you to do the same thing for Clark. So copy, Jerry. War cream work or whichever fall and Do Clark. Same thing. Copy. Jerry and Lois, let's where Five. You have all those files. There you go. We got all six files. So now 34 has recreated with touch Command three compiles recreated with the ah copy command. And the rest of the files will create using V. I now remember V. I is a very tricky so I will only create one file on. We will cover the V I later. So be I. Space Homer. So hit. Enter. Once you hit enter, it will bring you to file editor. Now, be very careful what you type in here because you will not be able to get out if you really don't know what you are doing. So at this point, I just want you to do shift Colon W as in right Q as in quit an exclamation point, which is also for as bank hit. Enter the file. Homer is created. How do you verify? It has to address myself to your And there you go. The home or file is created. Now the other three files I will create by the Touch Command. Now you will notice You don't have to run Touch command over and over again. You could run the test command just once and do bark space Lisa Space and May or G March scenario with this Just one command. It will create three files so hit. Enter verified. All three fathers Bart March Lisa off them are in this directory now. Ah, the next step I want you to do is create directories with in your home directory. So just do pwd just to make sure you are in home directory. Then from here, you do em que de ir space Seinfeld. Now the directory is created because you got you got your prom back. How do you wear? Abide unless mind sell tr and you see at the bottom That's where the directory is created. And if you notice some of the limits, distributions also changed the color for use of this way. It will be easier for you to identify which one is the file or which one is a directory. Same way launched to create another directory M k D I o r Superman. And again, you could also do the same way. Uh, instead of running, um, come one command after the other, you could just run one command and followed by two different directories. So the second victory we have a Simpson Simpson and hit enter once you hit and turkey and do this myself to you are the all three directories at the bottom and you have all your files right here listed here. So this is the way you create files and directories in your home directory If you try to create a directory in, let's a slash or somewhere else where you do not have permission. It would tell you that this directory you don't do not have sufficient right secrete directory. So let's take example if you go to CD, slash, etc and I want to create a file here, let's call it, um, test 123 and hit. Enter. Gonna tell you you do not have permission to create that fallout in there because we don't loan slash Who owns the slash root owns it. And you are not root. Who are you? You are yourself. In this case, I have salt again. We learned 34 commands Touch copy the I to create falls. And the last command we learned to greet directories is M k D I R. 17. Pipe: pipes. A pipe is used by the shell to connect the output. One commander to the input off another command. The symbol for a pipe is a vertical bar. The command Centex is command or the option or the argument. And then you pipe it to another command with its option argument if there is any. Basically, if you want to connect to command together or if you want to take the output off the first command and pipe it to a different output, then you could use a pipe in a my keyboard. A pipe is somewhere the key all the way to the right. It looks like that. And in a regular key ward Ah, you'll see the pipe option is right below the backspace. And you could do, I think, with shift and pipe. Um, so the way it works is you have Ah ah, you have a command. It goes in tow a pipe and it comes out the output. So let's say if you have Alice minus l, that's a command. You run, you pipe that the exact same, um, pipe character that you use and you put another command to were to refine the output off your last command. So let's look at the example in our Lennox machine if he our in slash etc. Directory by three where your we are in our home directors If if you go into CD Zach etc. Now, this directory has a bunch of files and directories which you cannot view all in one page. It will display all at once. But everything will scroll up so fast that you wouldn't even able to view one by one. So when you do ls minus lt are you hit? Enter. You see? It went up so fast what you could do, you could scroll up. So of course, when you to scroll down slow by slow you're going to see all those, um files commands and directories that are inside off at sea. Now you want to view all of them one page at a time. So how do you do that? The way you do it, you put it in a pipe. So you first you do ls minus. Lt are you. Pipe it. And then there is a new command that I want you to learn which is called more more is the command which gives you the output off a file one page at a time. So when you do this myself, tr pipe it and more it enter. Go now you'll see one page at a time off all the contents off, etc. Directory and at the bottom. It does tell you that it's more you had space bar to go down to second page space bar again . Space bar again, wherever you are, you could quit out if it beheading que and you'll get your prom back again. Let's do up Arrow Key hit Enter Space Bar Space Bar Space Bar Space Bar to go all the way down. You could keep hitting the space bar, and that's your problem back. So that's how you put in a pipe. You could also do a pipe to have the output off our command and change its output to a different way. Let's say if you want to do ls, by the way there's another command, which is Ah, a simple command. If you wanted to learn is l l, which also give you the result as if you are doing ls myself. So you do l and you'd learn to command mawr, which give you one page at a time. What if you wanted to get the last line off you output, then you run at its my cell. Pipe it. And to get the last line, you will have to do tail minus one. It gives you the last line off your output. Now, tail is another command, which is also a cool command which will give you the last line or lines off a now output which will cover later on. So this is what the pipe is. I want you to try with different commands, learn about pipe. Um, I'm not sure if there is a man page for pie because it's a character, but let's see. Yeah, there is none. But if you wanted to know more about pipe, I have some documentation. You could get it, or you could off course, look it up online to find out more about pipes. Ah, the pipe has is very important for our lessons that we will be covering Les Iran because this is how we gonna combine our commands 18. Files and Directory Permissions: file permissions in this lesson, we will learn how you could change permissions off your files and directories. This way you're protecting your environmental files and your directories from being viewed by other users or being deleted by other users. UNIX is a multi user system. Every file and directory in your account can be protected from or made accessible to other uses. By changing its access permissions, every user has a responsibility for controlling access to their files. Permissions for a file or directory may be restricted to buy it types. There are three types of permissions. Read right and execute. I'm sure you know, read and write. What does it mean by execute? If it's a program, if it's if a file itself is a script or program, it has an ex permission, which is executed herbal. Not everybody is allowed to run a certain permission. So if a user is allowed to run a program, they would have executed herbal permissions to it. E permission, which is read, write and execute Herbal can be controlled at three different levels at a user level, which is yourself at a group level, can be people in the same project or group or same department or others like everyone else . File or director permission can be displayed by running LS minus. L command. So you will see here at the bottom. You'll see. Read write X. The first bit shows that it's It's a file. The The next three bit shows it has read, write and execute herbal permission by the user. The 2nd 3 bits are for the group, and the 3rd 3 bits are for the others. Command to change. Permission is change Mod Ah, lot of times salts referred to as she Ahmad. So let's look at our links machine. So this way I will better explain you how permission works again. The first step you always do is to check who you are. You are yourself. Which director you're in, You're in your home directory. And when you do ls this command will show you documents and folders and files. But it's not going to show you the details whether it's a directory, what permission it has or what's the size off it? So what's the option we use? I'm sure you know this by that by now. Ls minus l or L T R. Whichever you prefer. So when you do ls minus l You see the listing off all the files with all its details. Now let's pick one file. That's pick. Um, we'll pick Jerry. We also use the option ls minus. L Jerry Here. You'll see the first bit right here, Dash. This one refers to as its a file this second three bits referred to as read right and execute. Now this shows the user I have solved, which is myself. Who created this to file has on Leigh read and write permissions. I do not have execute permission. It means I This file is not a script. That's why it does not have executed herbal If it was a script that it would have x to it. So I have me myself, as I have sold, has a right and right to read the file and right to right to it. The second group who owns it who has a permission is right here is Har w and again Dash which means the group which is the group itself, is also I have soul also have r w and dash and the last one is other. These last see permissions is that the others are can only read this fall. They cannot write to it or they cannot delete to it. So these are the permissions at the level off user group and others. Now, let's take the command to change these for permission. What's the command to change? The file system is changed. Mod Again. Every time you are learning a new command, I will highly recommend you that after the lesson you run man and C h m o d they followed by the commanding. This will give you all the details about the command, what it does, what options it has, what the commands are used for and so on. So I'm gonna use C h M o d command and I. What I wanted to do right now is I want to have the group right here. These three bits. I want this group to not have the w the right permission. So I will do. Is G as a group minus w and the finally Jerry. So what I'm telling the opposite system to do is remove their write permissions from the file name Jerry again. This shows that I have a command right here. and these are my options. And these are my arguments. So once I execute that, you will give me my prom back. And when I do, Ellis minus lto my cell, Jerry, and you will see right here. Now there is no right permission. So anyone in the group I exult cannot write to this fall. They could still read it, but they cannot write to it now. I want to remove the read permission from everyone. So the command to do that is C h m o d. And if you want to do for everyone, the Usu's A As for all minus or and which fall are you working on your working on? Jerry? So you hit. Enter and you do ls minus lt Or or just l and Jerry, You will see no one has read permissions. Now we only have the right permission by the user. I have sold. I want to remove that right permission as well. So what would do C h m o d? And now which option? Um am I going to use and will use you as a user? Remember, we had three different groups. Three different ways. We could change it right here. Eat. Permission can be controlled at three levels. U g and O. So I'm gonna use you as because you as myself. Minus W. Jerry, how did you ever fight again? You do at this myself, Cherry. And there you go. Now, you could tell by looking at this file that it has no permission. So even myself, if I wanted to delete this file, I cannot delete this fall. Let's look at our M to remove a file, Jerry, it will say remove right. Protected, ugly, empty file. It is giving me the warning sign that you this is write protected. If I say I guess that it were amore. Because since I'm the owner, actually, but it does give me a warning sign so I don't want to remove it. I'll just say no. And then if I wanted to read a fall to read a file, you could use the command cat, which were liable cooler later on. But for this lesson, I'll just tell you, Jerry, we could do the reid, and I will see it says permission denied. Why is that? Because I don't even have a read permission to read? Uh, fall. So I wanted to give back all the access that all the permissions that I had in the beginning right here is the file on. I wanted to give back all the permissions. Let's start with first User C H M O D. And the user is you and I want to give Plus because I'm adding permission. I want to give Reid and w and Jerry. Let's see if it has a permission. They want. Yes, it has it now the user has it now. I wanted to give this group the same thing. So what do you do? By the way? You could run up arrow key to go back to the last command that you typed. So this, in this case, will just to replace you with g hit Enter. Let's check it again. And there you go. We, the user has it rewrite. The group hasn't read right, But others don't have anything. We're hoping recreate the file. Others had to read permission. So I wanted to assign to others as well. So the command to do is is changed mod others plus read. Jerry, Let's try it again to see if it worked and it did. Now we got all the permissions back. Now this same command works in a directory, works on a link and works in a file you could use on Anyone said these are the three permissions that you could see. You have this permission column. The first column in your ls minus L output. This would tell you what kind of permissions you have now. What if a directory has this Execute herbal right here? Does that mean the directory is a script? No. The reason it means X here is because you could CD into that directory. That's where you have X in the directories. So if I have this, um, directory called Seinfeld, I could do CD Seinfeld and I log into I could actually get into the Seinfeld directory. Now let's go one step back and to a less minus. Lt are again. And now I don't I want to take away the permissions to f for everyone to go into the directory. So what we'll do is change mod. I want everyone so a minus execute herbal sign ful. So now when you do ls my sanity or you'll see this directory has read, write but no execute herbal, read, write no execute herbal, read, write nor read. Nor excusable. Nor right so Kenna and CD into the dirty. Now I don't know. Let's see CD's hind Phil Permission denied. All right. Why? Because we don't have executed. All right to that directory. We have to have execute herbal right to CD into that directory. So let's assign the permission back all plus X sign ful and this check again and you will see the sign for the bottom now has execute herbal, execute herbal and execute herbal. This is how you could protect your files and directories from being manipulated or being deleted even by accident. 19. File Ownership Commands: file ownership. In this lesson, we will cover how files and directories are owned and how we could change the ownership off those files and directories. So the file ownerships are created on user level and a group level. There are two owners off a file or directory a user, the one who creates the file or directory. And the 2nd 1 is a group. The user, the group that belongs to, If you are if you belong to two different group and permission applies. That second group has a read permissions. Or it could delete a file or directory as long as you in that group, and you would have that right command to change. File ownership has changed Own, which is also known as Chief Home and Change Group. C H g R P Change own changes. The ownership off a file changed group changes the group ownership off a file recursive ownership changed option. If you are using an option with change own or change group with minus upper case are, it will not only change that directory, but also all the files and directories within the parent directory. If you look at the example off windows Let's say we have this full dick, all videos. And when I click when I do right, click and go to properties will see that under security. This file is owned by the systems, and I have so and administrator. So you see these two people here? These are the group and a single user. One person here it's just a user. And again, the system is a group. So group system and administrator owned this file or folder called Video, and the user who created that folder is I have so and you see at the bottom it tells you whether that user has read, write or secure herbal permission. You could see right here. It has all the permission that we talked about in our Lennox machine. When we log into our Lennix machine again, the first thing, what we do, you see who we are. So we are ourself. See what falls or directors we have. These are all the listing off ours and directors we have now here in the 1st 2nd and hair the third column. The third column tells you who owns this file. Let's say we go to Lisa. We created this file Lisa and the person who owns this file, Lisa is the user I've saw or yourself yourself. In this case, the four column right here is the group name in this case is IVs all again because I am part off my own group. I belonged to my own group. I could change that to a different group. But since I'm a regular user, not a super user, I won't be able to change that permission to any other group. That Onley person or the only account that could change that. Ah, ownership is route. So let's become route s you dash. Once you log in, you do P W d. And here it will bring you into slash route. Now remember, you are not in your home. Director, You are in group director because you are route right now. So I want you to go to your home directory. Which is she remember slash home and slash or use the name. It will take you to your home directory. You could just to pwd to confirm and to a less minus. Lt are to confirm it at the time that these are your directories and files. If you wanted to change the permission off Lisa, and you wanted to change it from yourself. And you wanted to have this owned by route. What you'll do is change own and you specify the name off the user. You want to change too? And the name off the file, Lisa. And then when you do a less myself to your you will see right here the file is now owned by route. You could also do just to be more Pacific so you don't see all of the files you do unless myself, Lisa, and you'll see here. Now the file is owned by route. You could do the same thing when you do ch g r p, which is to change the group. You could do the group. Also, there's another group called Route, and you could do Lisa again on ducal. Verify it. And now you'll see this file. Lisa is owned by a route, and in the group who owns this file is also route. Now what happened when you become yourself again? How do you get out of this route account? You just simply type exit. You're logged out and just confirm who you are. You're yourself which directory or in your in your home directory? Do ls minus lt. Or And you see there is this fall, Lisa. Now what happens if you try to delete this fall? Let's see. RM Lisa, it will tell you. Remove right. Protected regular off empty file. If you say yes and duelist my cell tr There you go. It is gone. The reason it is gone now Why is Because And you go one step back to your home directory. So your home is right now is sash homes like yourself? And then you go one step back. You are in Just sash home and do a less my cell. Here, you'll see the of salt directory, which is your home directory has permission off yourself to read, write and execute. Meaning anything inside of the director you greed you could write and that you could execute to, regardless, if whoever puts the file in whoever owns the file our, um who whichever groups owns that you could go ahead and still deleted. Now, if you try to create a file in, let's say at sea and you go touch test file, it would tell you permission denied because you do not have permission to write to this file. How do you check that? You do ls minus l slash. You could do that or you could simply go to CD slash and do ls minus l. And you'll see here is a list of all the directories that are inside of slash and the one we were trying to go to is at sea. If you notice it at sea is owned by route and the group is owned by route as well. Now the route has the permission to write to it. But what about the people who are in roots group? They don't have a permission to write to it. What about everybody else? They don't have a permission to write to it. So that is why you cannot create ah file in at sea. So let's let's say, if you become root again, okay? And now you go to etc. And you create a file touch test 123 It's verified. A list minus L t r. You see, the bottom is your file. Now another way. What you could do is while we're working on this, you can minimize this window and you could open another window by right clicking and clear , open Terminal said. This way we have a regular account which is our account and the root account. So there. So if you don't have to exit out of a rule account So we are here. I have solved which director of urine, urine slash home and we created the filed in etc. Right as a route. So let's go to etc. And let's see ls minus l to your. And now we're going to try to remove this fall test 123 and it's gonna see it removed, Right, protected. It's just a warning. You said yes and it stills his permission denied. Now why? It's saying permission denied again. You go to a CD slash name and you do ls minus l and you will see right here. That's the at sea directory and it's tell you right here. The Group three bets do not have write permission and the other three bits do not have write permission as well. So that's how you change these user of the files ownership and group ownerships that the two commands that we learn is chief ownership, which is C. H o and w Sorry. Ow! And And the 2nd 1 has changed group so again really want you to do a man on each command and go over the description, The different options it has same thing you do with the with the second command as well. And also, I want you to practice this command by changing the permission Onley in your home directory . So your home directory is slash home slash yourself and you could try changing permission to one of the directory, like create a new fall. Don't testify that you created and just see permission test file create this while and just ah, practice your change. Um, ownership and change group. Ah, command on this file and see how you could change it. 20. Adding Text to Files: adding text to files or read Eriks Um, Harry will learn. How can we add a text or digital letters? Or how can you populate an empty file? Recreated some off the empty files using touch, command and touch is just, ah, a way to create an empty fall. But now how can we add text to those falls or anything that you like to add to it? There are three simple ways to a text to a file and the basic main ways to add textile files. The 1st 1 is through the V I editor. The Eye is editor. It's a command that is used in Lenox to create a fall and at text messages to it. Then the next one is redirect command output using the the write direct and the to write directs to a file, and this lesson will cover their these redirects through ah, command output into a file. And the 2nd 1 way, we will learn to echo when you want to echo whatever did you type? You could output to ah, file. That's how the file gets created. Or that's how the file get populated with information. So let's look at on our limits machine and run these commands. So here we have our links machine. Let's make sure we are in our home directory. Yes, we are in our home directory. Let's clear this green and let's check. What are the different files we have in our home directory? Okay. We have all those different files and directories that we created earlier. Now, we wanted to add something to, ah, file any empty fall. Because if you see here, these are the few files have he added. And all of them have zero bytes. And it because these are empty files. So when you wanted to do echo and you type Hi, my name is Imron and you hit Enter. It brings you back the exact same thing that you type. So the command echo actually echoes back what you shouted out. So how about if he output this to ah file? So I will say it's a echo, Jerry. Sign Fell is the main character and the show sign felt So this is the text that I wanted to type. I wanted to add into the file called Jerry. And how are we gonna do it? We couldn't do it by redirecting the redirect, which is a key right above your, um the dot You typed over the shift, and then you specify the name off the vile, which is Jerry it enter. You'll get your prompt back now, when you do ls minus l and you Hit. Enter. You're gonna see Jerry has 58 bytes inside of that file. Now, all of the fathers who are because we didn't put anything in there. Now, that's good. He added something to our first file. This is amazing. Okay, now, how do we know what's inside off this file? How do we check it? How do we verified? We do know that the CD gets into our ah directory. Unless lists all the files. And PWD tells us where we are about how we're going to see what's inside of directory in windows. How do you do it? How do you open up a file? Well, you do a double click and it opens up in Lenox. There is no double click. Then how do you do it? There is a command called cat Cat is a command to read the content off. A file will cover the cat command a little more in detail in the next lessons. But for now, if you want to know what's inside off the file, we will use a command cat followed by the name off the file, which is Jerry when you hit Enter. And there you see, you have Jerry Seinfeld is the main character in the show. Seinfeld. Now, this is what we typed right here in our echo envy. Output it that to a fall called Jerry. Now, what happened? If he'd do echo and do and and we wanted to type another line in that same file. So let's say, um, Jerry show waas created in 1989 and you put to our fathers Jerry, remember why we are using to output arrows Here is because if you use one arrow like this, it will overwrite your last file and remove this line that we added into this fall. You'll remove this line and create a new fall with the content off. This jerry show was creating 1989. Now we don't wire to remove it. We don't We want to keep this line the first line and we want to add a second line. If you want to add a second line, then you need to use the double redirect signs. When you do that and enter. How do you verify it? What's inside over Whether it went inside the file or not again, I want you to use up arrow key twice because that's the first. A Berkey brings you the last command. The second time you hit up Iraqi brings you the command to cat the Jerry Fall hit Enter And there you go. Now you have too far to lines in your file When you do ls minus l Last time you have 58 bytes. Now we have 89 bites because the file is keep growing. Now, this is the simple way to add contents Toe Ah, file if he running the same command again. There you go. Jerry Seinfeld is the main character in the show. If you take out that and you just do Jerry Seinfeld is a main character, right? And now we wanted to use one redirect, and we want to redirect Jerry. Now, remember this. It will wipe out all the contents off the file. Jerry, basically wipe off the entire file, Jerry, recreate the file with the new text message is text that I am typing here tried, Let's say hit, Enter do Cat Jerry, Enter. And there you go. Jerry Seinfeld is the main character. It does not have all the type things that we did earlier. It took the the latest one, the latest hyping the latest echo we did in the fall, and it added into the Jerry file the same way I want you to add a few things about anything that you know about these characters. By the way, these characters are actually taken from those hit shows American hit shows of Seinfeld, Simpson's and, of course, the main, Um, always Superman. Um, if you know a little bit about any of thes characters, please do right inside of these files with using the echo commands. And this would be, ah, very good exercise for you. How you could populate each file with different things that you know about again. Remember, if you do one single output that will override the fall, if you do double that will append to the file. Okay, Now this is about echo. What if you wanted to do that, create a new file called touch and ah, this time will call at, um listing. Well, file No listing. Off directory. That's what we call this, right? You hit. Enter Verify the father's created. Yes. Listing off de ir is just the name I pick. You could pick any name Now how do I populate that file? That what? Whatever I want to type in. Of course. You know, that way you could do it is through echo and whatever you want to type and output to a file . But now I want to show you a second way that you could populate through the output of a command, which is if I do ls minus. L could enter or ls minus. Lt are Let's say which brings me the latest one of the bottom. I wanted to have this entire output starting from here to here. I wanted to output this entire our entire result off my ls minus. Lt are into the file I created listing off directory. So we will do ls minds lt are output to listing Hit tab it auto completes your file and now you hit Enter You see what just happened? It is did not give you the output off ls minus. Lt are on your supreme what it did. Instead of giving you on the screen, it is out putting toe a file you called listing off directory a less my cell tr shows you that the total number of bytes this file has is 11. 40. Okay, awesome. Now what's inside off this Derek off this file, you could check by typing the command cat listing are tab and hit. Enter. You see, guys, it's a same output that you have as you would have it on this one. The only difference that you see this output gives you a different color because it is actually running the command. Where, as this output cat of this listing is just the simple text messages texts inside off a file , you could change it. You updated whatever you want to do. If you want to Due date and you want a pen that date, by the way, the output of date is today's date. And if you want to append that to the file Jerry hit. Enter now verified. Jerry. You see, it has the first line, that V type to echo command, and then it has the second line that we got it from the date. So does these two funny characters. The output to, uh puts a pence to your existing fall and does not delete your fall. So again, these other two ways have you learned one through the echo and redirecting and went through the output off a command and redirecting toe afar. And of course, there's another way is a V I devil cover later in the lessons. But now, right now, you have to practice thes two ways off, adding are a pending toe a file. 21. Help Commands: help commands. Now, what are the help? Commands, Um, that are used in Olympics environment That will give you some of the information or some help about other commands. Ah, there are three types of help command their use in most of the Lennix distributions. The 1st 1 is what is. So whenever you run a command, what is followed by the command that you want to inquire about, You'll run waters and spaced and command. This will give you a quicker assure version off the information about the command that you're looking for. The next one we have is the command. Whichever command you honor on, Let's see ls space and then dash Dash, help! This will give you a little Ah, bigger. Ah ah! Longer version off the help of it. More details about that. The options about that command and the last one is man, which is stands for mental man space, followed by the command the man name itself. When you run that, you'll get a complete full listing off the command descriptions that help about it. So now let's look at our Lennox machine and we'll see how these commands work. So we're here in our Lennox machine. Let's to the clear and you'll find out we are again. Who am I? View ourself. You type clear. The first command of you learned weaken A run is what is It's all one word space. Let's say, ls this will tell you the let the s is list the directory contents. The next one will run ISS. So what a CD. That's what tells you the bash built in command. The CD is a bash built in command, meaning when you have your Lennox system installed, it comes in its pre built command. And what it does it change the working directory from one directory, of course to another. Well, let's try the same command to what is pwd Ah tells you print name of current working directory returned working directory name. So why do we have two different, um, answers? Ah, for one, command is because we have two different sources or two different dictionary already installed. Ah, are you could say two different mental pages installed on our, um on our limits distribution. There are there could be more that could be 234 or five, depending on what type off command it is and what kindof description it has. Let's look at the next command. Let's say ls dash dash, help. Um, see their ago. It gives you a little longer description off your Ellis command, and it tells you all the different options that are associated with less command. So of course, right here. That's where it starts. And it goes all the way down. Tells u minus a option minds uppercase option and so on. Um, because also run C h m o d dash dash help. Remember, C h m o d command A za changed my command of a change the permission of a file. So when we do help, we're going to see it tells you, gives you quick description starting from here. It tells you that change the mod off each file to that are a file changed, Ahmad, if each file to mode and a few different options, um, same thing you run this command with other different commands. Space doctor slash data help. It will give you the information about the command. Now, the last one we're going to look at is the man command man, central mental, and then space. Let's say Ellis and you run this command, they go. It will give you a very nice, descriptive way. Ah, nice formatted way off the user command information tells you the name snaps is the description and each option off the command. You could do space to go. Ah, on each page. Ah, hit space bar space bar Every time you want to quit out. Just had Q and you're gonna be out if it same thing when you do a man command and then pwd you do, um, enter and you're going to see an exact same thing. Www Deeper in name of the current working directory. And what are the options? It has my favorite command. Um, in all those help commands is this man command because it has exactly the information that detailed information off each command? 22. Welcome to Sunday: Welcome back to your second day Sunday. Now I know I am ruining your beautiful weekend, but trust me, these two days and few hours spent foot on these two days are gonna be well worth. It said today we are going to cover the Advanced Lennox System Administration. 23. File Maintenace Commands: filed maintenance commands and this lesson, we will cover a few of the commands that are used to maintain or keyboard. Change your files. Some off the commands are listed here. The 1st 1 is the copy command CPI, which copies one filed to another. The 2nd 1 is to remove a fall, which is our M. The 3rd 1 is move. This command is used to move the location off a file from one location to another or to rename a file that does. Two things are it serves to purpose. Then we have M k D I. R, which is to make directory and then rmd ir to remove a directory. Or there's another way to remove a directory by typing R M space. Dash are or hyphen are. Then we have changed group, which is the ownership off a fall, um, at the group level. And then we have changed ownership, which is the ownership off the file at the user level, some of the commands we have already covered and some off the commands we will be covering in this lesson. So let's go to our links machine and gold were these commands one by one and that's log into our machine. We already have the last green open. Let's clear this out. Ah, where are we? We are in etc. Even you type CD and hit Enter and then PWD Now you are back in your home directory. Clear the page said this so you'll start fresh. Now the first command of you will be learning is CP against CPIs. A copy command. You could find out by hitting Man and CP. This will tell you CP copy files and directories. So the way you could do it in Windows is you right? Click on a file and you get the option of copy. And then you go to another file. Under the directory, you're in the location and then dry Click into the paste. And Lennox, this is how it works. We will. Let's let's look at our listing. We have all these falls. So now we will copy the file called George, and we will name it to a different name that say, another character off a show. David and you hit. Enter. So this would tell you that CP based source, which is the George and the destination, which is a David you hit, Enter and then you do ls minus lt or the l. The TR option will give you the newest fall created the bottom you enter So the David file is created. If you also notice the George file is still there. And it created a fall a copy to file George and rename it David. Um, we could also add something to the file is, let's say, a coke. David Huddy is the lanes boyfriend. And then we'll up to David and hit. Enter. And how do you verified you do cat David? So you're see the contents in there? Um, that's what you do. The copy for you could also do. Is you copy? Ah, David. And then you could copy it. Not at this location where you are. You copied some other location. Let's say we wanted copy into temp. Ah, location. So it is going to copy it. It's not going to remove the volatile. Copy it to the temp directory. Enter. Do ls myself your You'll see it. Has the david copied the original copy here. Now we will go to slash temp, and then we will do unless myself to you are the bottom to see the father's there. See the same file that he copied. But it's in a different location, and it is owned by me, owned by the same group as myself. And it has same number of bytes you could do Cat and David to see what's inside off the file service. Derek, you are in. We are intended victory. If you want to go back to our home turkey, just simply type CD hit. Enter PWD and you're back in your home directory. Alice myself, your and that's what you have your all the files that survived a copy. You could practice that copy command by copping different files or different names, whichever names that you like, the next command we're gonna learn is remove. Ah, let's create in the file touch and we will create a new four off um, Homer barred March Lisa and we call another file. Ah, poop. Apu is another character off Simpsons family, so we'll create this file called APU on. We'll do ls minus. Lt are and you'll see it created the fall up poop. And if you want to upend a fall or add something to laugh about, what he would do. We do echo. Ah poo is an Indian character in the show, right? So I'll put that to where ah poo. How do you wear a fight? A pool? Polls indicate that's how you do it. Now You want to remove this file now, after certain times, you don't need it. So what you do you'd do R M a. P o. Rachel simply is that enter and it's gone. Let's try. Let's make sure it's gone or not. Yes, see, there is no such file up who in our directory? Because we removed it. We could also remove a directory, but we'll cover them and it turns gonna come. The next command we have to learn is move, move. Command, actually move the file from one location to another and also renames off. How does it work? Let's call LAX and Superman. There's this character, of course, is villain. Character lacks. So let's see, we have the legs. Yes, we have. They're We wanted to rename that to Luther. So lax. Last name was Luther. So let's try. We wanted to change, Luther. So how do we do it? We do, move lacks. And this is of course, the source. And what's the destination Name. You want to give it to Luthor? L u h t e r. This is going to rename this fall within the same directory. It enter Ellis myself to your and year. You see, Luthor. So this is how you rename it? Um, if you want to rename any other file Ah, you could do that, or you wanted to create a different file. You could do that. Let's say you we have this fall called, um David And he wanted to change to the last name, of course, which is move David to Putty. So that's his last name. So we're moving David to the name Putty. So that s my SLT Or so it changed the name from David to Putty, but it kept the content off that file, which was a few new cat. You'll see David parties, Elaine's boyfriend. So it just changed the name. It didn't change the content. Next one of you, by the way. Also to change the location is if you want to move Huddy from this location to a different location, that's if to temp, it will move that file to a different location temp. Now, let's see. Do we still have the file? No, we don't. Where did it go? We moved it to tempt. So how do we know it moved to tempt you'd CD into temp ls minus. Lt are. See, this is the putty file that you created. Now this. Move this back to more putty. Back to our home directory. And what is our home directory? You guys, you know that home here, or use the name and hit. Enter it should bring you back to the your home directory and you do CD hit. Enter it will bring you back to home Directory to us myself to your and your party follows back. Next one is make directory. It simply will make em Katie ir game off. Thrown one of the biggest show. How's that? Um recreated this. This is how the new directories created Make d I r. Now let's try command which is removed. Directory. So removed a tree. If you wanted to lead one of these surgeries from your from your home directory that they wanted to remove game of Throne directory, You just simply type RM d I r and came off thrown and it is gone. This is one way to remove it. Another way to remove it In order for us to remove it. Lets recreate it again. Hit up Arrow key and you will get back to the same command. Make the I R. A move thrown. The doctor is created. Another way to remove it is RM Dash are I came all thrown and it is gone. All right. Next car Mary have changed group changing group as changing the ownership off the far changing the ownership off a group off a file and that the last command is changing the ownership over file. So if I wanted to change the ownership off file Putty, um and I wanted to change it to group called Groot. So we will do change. GRP wrote Huddy. Um, it's his operation not permitted. Why? Because who we are? We are ourselves. And who could make these changes? If I want to assign something to root, I have to be route. So let's become route once your route. Let's go back to our home directory and now do is change g r p route and party. And this time it worked because we have all permissions in the world would think off now. Next command, change ownership to root off party. This will change the ownership off the filing party to route as well. Now, if you want to do ah both commands at once. A change owner you could do. I have solved colon IVs All hurry. So what this command will do? It will change the ownership as well as group ownership of the file Name. Party hit. Enter response. Lt r and they go. You got your file back where the original permissions are original. Order for permission. So these are the file maintains command once again. The recap cp rm. Move em que de ir removed the i R change group changed ownership. 24. File Display Commands: file display commands. This lesson cores about all the commands that are used to display the content off our file . You give you the file by doing ls minus. Lt are, but and you could How can you view inside of the file? The first commanded Alcoa is the cat which views the entire content off a file regardless, whether is one page or two page um mawr command or less command both hard the same. Um, but Mawr views the continent a file one page at a time where, as less command views the content for off a page in reverse order. But it also allows you to view one line at a time. Then you have had, if you want to know a few lines at the top off Ah, for file. That's a for five million lines, and you just wanted view the 1st 10 lines you could use head command, followed by the number of lines that you want to view the same way the tail works. Instead, off the top of the file, it actually gets you the lines at the bottom. Off the file. A gain of her father's woman has a 1,000,000 lines and you put tail minus 10. It will give you the last 10 lines off a file. Let's look at our, um, Lennox machine and see how we could use these commands. Okay, so let's clear this page out. Okay? The first thing I want you to do is copy the file called War Log messages and copy it in your home directory. You could do slash home your home directory, which would work. Or you could also do copy the name or the location off the entire file and followed by space and dot dot means at this location where I am, you could enter. And now you do ls minus lt, or you hit. Enter and you will see at the bottom. Right here. It shows that you have this file, which is 129338 bytes long. By the way, you could view you could copy this file only if you are route. So when you do, Who am I? You are route and you remember how you will become route. Let's say if you exit out off it and you do, who am I yourself and now you gonna copy war log messages to your current location. It's not going allow you. So you have to be route to become route s, you space dash. But in the password. And now you are in route. So go to your home directory. They uses home director, which is your home directory. And then you'd you'll see here This has this message is file that you copied from war log and the reason you were not able to copy it because you see here Onley route, which is user The owner of the foul who is route is allowed to read and write to this file . The rest off people, which is group has no right anything and so on. The others have no right on read right to do anything. Let's go back to our commands that you were cover If I wanted to view the contents off this file called messages. The command to use is cat messages. Simple is that you hit Enter. See, it has all those contents messages. Basically, this messages file has all your logging information off your system. Anything that is going on with your system any, um, services that are running any air messages warning messages coming in the health of your computer. Everything is stored in this file. We copy this fall in our in our home directory just to cover the file display command lesson. So do clear, and then do cat and messages again and you'll see it has a bunch of lines, text lines in it, and we could view through cab. But then we have to scroll up so another way that so you don't have to scroll up. How do you do you doom or messages you had enter and there you'll see, you will get one page at a time off that filed messages here. You'll see it says 1% the bottom. You hit space bar to keep going down. Keep going down your going one page at a time. And while you're going it also telling you the percentage off the file you have read. You keep going down. And if you wanted to get your prompt back, what do you do? You simply type que. So that's how you use the more command. Now let's use the less command less command space messages had enter. It does the same thing. You hit this base bar that the space for one page at a time. Also, it will give you one line at a time to view it. When you hit J in your keyboard will come one line at a time or you had K, which is is Go back up. You could also do up Arrow Key or Down Arrow Key, which ever that you prefer J R K Upper cure down or keep whichever you prefer, so that's one less allows you to do next. One we have head. If you do mawr and messages, you see the first page off your file messages. What if you want to see on Lee the 1st 2 lines? You don't care what's inside the file after the first full line, then what do you do? You do head minus two space name of the file messages, and you will see the 1st 2 line off the file. Then you'll do tail minus two messages. This will give you the last two lines off the fall, which is Ah, the last who is March seventh 3 10 You could do cat again two messages and will bring you down to the last page and you go verify Yes, the's word, the last ones. So to wrap up recovered cat Command, which lists the contents off your file regardless how many pages it has, it's just displace everything in one shot more gives you one page at a time. Let's give you one page of the time in reverse order, but also view lets you view one line at a time. Had gives you the first lines, depending on what you define until gives you the last lines, depending where you have defined. Um, now exit out off, um, fruit account, find out which doctor you're in and do a less mind sell to your and you will see. Ah, there is a file called Jerry in there. Um, let's do Cat and Jerry and you will see two lines and Jerry file. The first line says Jerry Seinfeld is the main character, and the second line shows us the date and time off file another file, but an output or a text message, whatever that is. If I just wanted to view the first line of the file, I don't care the second line. What I would do is head minus one Jerry, and it will give me the first father first line. Of what if I wanted to view the last line? I don't care. The 1st 1 that says Jerry Seinfeld, main character. I just wanted to know this line. I will do tail Ice one, Jerry, and it will give me the last line. So this is how had entail work. 25. Filter Text Processor Commands: filters text processor commands. In this lesson, we will learn all the commands. Fun command, I would say that are used mostly in Lenox. These commands are very powerful command. And it gives ah huge advantage off Lennox or other operating system. Some off those commands are cut. Look, grab short, unique. And Ford count. Here are the six basic and very powerful command. If he will learn, I log into the Lennox machine Now, Now, this time I have a log into the lyrics machine through party client. When you open up your party client, you put in your use the name and I p address off the machine that you're trying to connect to. And you would put in a, uh, last you for the password and you log in. Now let's see who we are, where you are. What's inside of our directory? I want to log. I want to change my directory to the director called Seinfeld. In this directory, I created a file signed ful characters. This is the file I created earlier. Just for the purpose off this lesson. To view this file, you have to use a command cat, and I'm sure you remember this because we covered that in a few lessons. Back when you do cat sign fill, you're going to see the contents off this file. Seinfeld Dash characters. Now here is a list of all the mostly characters that were inside the in Seinfeld show. I don't want you to focus on the characters itself in Seinfeld. I just want you to focus on the text that it is inside off the file called Seinfeld Dash Characters to show you how the cut command works. Let's first do cat signed filled, which we did. And what if we wanted to get the first letter from each line? Teoh, get that output. We have to use a cut command. So you would you run command cut minus c and you want the first letter? So you're but one followed by which filed that you want to cut it from from the file signed flash characters you enter. You'll see it gives you the output with on Lee the first letter. What if you wanted to get this 1st 2 letters? Are you gonna use? See, I said it will C one to C two. No, because if you type see to it will give you the second character from your output. What if you wanted to get the 1st 2 characters, then you would have to specify the range one through to then I will give you the 1st 2 characters from the output. Now this is the primary used for the cut command. If you want to cut the text and it's not really the cut and paste as a Z, you could think off like in Windows. You cut, ah, file and paste a file. It's up. It's not even cut. Uh, and you do. When you are in Windows, you you're cutting. Ah, a few lines or a few words and pasting it somewhere. It's not that it's on Lee to cut the characters out off it. And then, of course, you could move it to a different file, like by out putting it, too. Ah, first mm to character, just put C. So when you use you notice and you do ls minus lt or you'll see and you do cat, it created the file with 1st 2 characters in the file because you used a cut. Now let's move on to the command talk again That's dues. Cat sign fell Oak separates each column in a file. So in my file Seinfeld dash characters, you notice we have two columns. One is the first name. Second is the last name. What if I just wanted the first column or the first name? I would run a command talk single code curly braces, print dollar one curly braces, close single court close and the name of the file. This is going to give me the first column off the file. You could also run the same command by typing cat Sign fell, and then you use pipe and do walk, print, dollar one and close. This gives you the exact same thing. Um, and basically, pipe actually takes the takes. The output off this file puts it in the foot pipe, and it shows whatever the way you want to show. What if you wanted to view that their second column, which is the last name you put simply to. And there you go. You have a last name there. What If you want to see the third column? Nothing. Why? Off course That is not there. Okay, let's move on to the third Command, which is a grip. Grip is actually like a search as if you have. You are in windows. You're searching it when you do control left, you're searching it. That's exactly what group does. So if I wanted to grow up, um, the name Seinfeld inside, um, the file Seinfeld characters. I didn't get anything. Why? Let's look why I didn't get anything because the signed for last name has upper case s in It said That's why we didn't get anything. So let's put up our case and there you go. You will see it on Lee. Grabbing the sign Felt What if I wanted to grow up? Um, only Costanza's Costanza and it on Lee gives you the list off all the lines that matches Costanza. Let's see if I wanted to do Cramer again. We didn't get anything because Cramer has a K upper case and they go, we got two lines of matches are, um, criteria. So that's how group works. Their grip is very powerful. You go combine many different output to a group. There is also eat grew up. So I want you to actually learn more about grabbed by typing man and grab and try different options. Also, you could use some feel free to use Google and see what are examples you could find on the crap. Ah, the next commander will learn is to sort Command, as it sounds are at its named short shorts to file. Um, if you do cat sign fill, you'll see, um, it's not sorted in alphabetical order. Meaning like Jerry J. Starts with J, where, as a right hair, Elton should be on top. So what? How to be sorted? You could simply type sort and Seinfeld, and then you'll see it is sorting with alphabetical order. So that's what pretty much sort commanders used for. You could also use short and reverse order if you want the, um, you or Z the bottom. Let's say right now when you ran short Seinfeld character you see right here Uncle Leo is is at the bottom because it started you. What if you want to have in reverse order so you just simply put in the option minus are and you will see uncle your now it's on the top. Now let's look at this next command, which is unique, unique removes all the duplicates from a file. So let's do care. Seinfeld and you notice this, um unique. It's not gonna work because every line is different from the other line. So what we could do is we could get on Lee the second column. So this way, the second column is gonna list only the last name. So if you see on the last names now we have ah, Seinfeld. Seinfeld to duplicates, actually, three duplicates and three Costanza and so on. Um, we just wanted to have one family member. One family member out of every family said this way we could use a unique. So you hit up arrow key again, and you type sort here because, remember, always you sort before unique. Um, I will tell you why in a little bit. So you just sort it will sort it out, um, from alphabetical order. And then you type unique. And there you go. You'll see everything. All the duplicates are removed. Now what if you had not used sort and just use unique, you'll notice that it has signed fell here and Seinfeld here to it gave you to sign ful. Why? Because it has to be shorted first. Before this unique toe work. So that's why we used sort and unique. It's clear the screen out next, commander, we're gonna learn his word. Count. Word count counts the word inside off your file so you could simply run W c The name off your file and you'll see it tells you it has 17 lines, 34 words and 236 letters or characters inside off the file called Sign ful Dash characters . This command is very powerful and very useful when we wanted to count the number of lines in riel in really enterprise environment, sometimes you have millions off line in a file, so it's good to use this command. We could also do, um, cat, Seinfeld and W C. If you if you only wanted to know the number of lines in a file, so you just do pipe it and wc minus salvages for lines. Don't tell you 17 seem as we had it before. So this is what the WC is used for. Ah, and these are all the commands used for. I wanted to compare real quick All these commands toe our windows, um, environment. So in windows, um, I have this Ah, file that. I put it all copied everything, all the contents off the file here. And I wanted to use the cut. Meaning, what if I wanted to get only the first letter from this file? Is it possible? I don't think so. It's possible. Or if it is, then it might. You might have to do a lot of different things to get it to work next. One. You want to only get this second column or the first column from this text file in Windows . It's gonna be so hard. You probably have to do text to columns, or I don't know if that works in vende en board. Next one is grab Grab one works most of time if and it's by the control F or to the Search Command, but it will give you the group one at a time. It's not gonna take out the output and give Put it in a different file, wherein Lennox you could do that so short you could you could get that sort done in windows . Ah, unique. I think we also get the unique done, but I really don't know how that works. And the last one is word count very hard to do to do the work count and windows. So there are so many different filters, these commands that you could use in Lenox and these are so powerful over Windows environment. So that's what about it. Please. Um, I highly recommend you to please do man command on every command that we learned in this lesson and use different options just for practice. So this way, you know, some off the options that are used with these commands. 26. Finding System Information: finding system information Every time you log into a Lennox machine, it is very important for everyone to know which system they're logged in. Terms off what operating system is running or what hardware it has underneath what's under the hood. There are few commands to find that out is if you cat out the etc Red had actually release file will give you the information but its opening system the unit minus a, which will also give you information about operating system and some colonel information. And the last was D M. I decode this command will also give you the information about processor memory, the hardware that's underneath the operating system. Let's look at either each of them one by one. And this time you log into our next machine toe council. Okay, let's clear this out. We are who? Um, I we are route. I want you to exit out if it and become yourself. Who? My, You're ourselves. Where are we? Home. Very create. Once inside of our Dre creep, the same listing of the files. Now, let's just make this a little bigger when you do Cat at sea. Red Hat release. This is the file. It's Ah, text file. It would tell you that we are running. Sent Os Lennox $7 4 and the update 1708 The next command we have that we're gonna learn as you name minus A This one tells you this is Lennox the host. Name off. Dull Minnix. This is the colonel. Worsen. This is a red 76 30 64 bet tells you the date and time. Um And when was the system actually was built? Is or package together and again? What's the architecture off it? It tells you all the information about the opening system and the last command is D M I D code. You will be able to run it on if you are a regular user. So see it say's permission denied. So what we do, we become fruit idea Roadless. Clear our screen. You want to have a d m I D code and enter. All right, so it through a lot of information. The screen If you notice very fast, see if you scroll up So we could I had to do the scroll up or what's the other way to do you do the M I decode Hit up barricades space, pipe it and do war cervical view the output one page at a time So he enter. And here you will see the BIOS information the virtual box What kind of computer it has underneath What's the wrong size? Um, we re created the memory information. The system information the manufacturer here, manufacturer information. Ah, baseboard information also appear we miss one thing has a serial number. The product name is virtual box. Remember, we were running on Oracle Wardrobe box that manufacturers Oracle Corporation. Chazz. He's not specified because there is no chassis and need and it's to give you some processor and some information about memory. So there you have a few three basic commands that I think a system administrator or engineer should know about which system they're locked into because the first thing every time whoever logs into the system, they should check. They should run the first commanders unit minus a which should give them the exact information about the operating system were locked in. Also, another good command is always one host name this name, and this will tell you which host name you're locked in. So the reason. I'm saying the host name is important because if you are a task to reboot a UNIX machine and your log into a different lengths machine by accident and you do Riboud the machine, then you could cause a lot of trouble. So just be careful, always log in in this type listening. 27. Linux File Editor vi: Hello, everyone. In this lesson, we will cover the Lennox File Editor and editor is a program which enables you to create and manipulate data or text Analytics fall. There are several standard Texan editors available on most Lennix systems. You could use V i e d e x e Max PICO and women, which is a van. Them is the advanced version of the I. In our lesson, we will focus on V I. Why? Because V I is available in almost every Linux distribution, regardless of which Olynyk system you log in it. Whether it's a bun to Soucy Red Santo s, you're gonna find me I everywhere. Plus, it's very easy to learn. The V I editor actually supplies commands for inserting or deleting text, replacing text, moving around the file, finding substitutes, strings and cutting and pasting text inside. So that's what we I does when you have to write to a file, the most common keys are I, which is to concert escape, replace before our Defense league and quit without saving and quit. Right, but safe. So let's look at our Lennox machine, and at this time you will log into our Lennox machine the Linux virtual machine through our police station. Okay, um, that cd my and wished Eritrea in in this derek tree, I want you to create your first file. So call it the I, which is a command space. Uh, my first added to her or just save my first. Well, how's that? Much easier hit. Enter now. When you hit enter, you are still in command mode. You're not an insert mode, so there are two different modes. Once you are in the V, I his first more is to when you run the command. Second mode is when you inside of the V I, and you start typing it. If you want to get out of that typing mode, you have this escape. So now let's start. Let's see if I want to type into this file. You hit I or insert lower case I As soon as you hit I you see at the bottom it say's insert . It means we are an insert mode now. Already limits commands won't work are because we are an insert, more so that he could type something like Hello world. This is my first lesson to learn, be I and you could hit. Enter again, um, so excited about. So it's just simple as if you're trying award document now if you wanted to exit out off it . If you want to save this wall, all you have to do is hit escape right here. And once you hit escape, you'll see the insert mode is calm. Now how do you save this file? You could do through two different ways. One. You hit shift is easy, the twice, and it will save the file. Let's see if you do cat again and do my first file, you'll see it's there another way to save a far. Let's go back in the file, my first ball and let's say you want type something, um, hit insert again and then high space. And now you want to exit out and save his escape. And this time, instead of shipped, is easy. You type shift calling, right. Quit and exclamation point, which is also referred to as bag you had. How do you wear file? You read the father my first file, and there you go. The file is there. So this is these are two modes is once you get out And once you get in now, I want you to go back into your fault and it be I and my first file, and I want you to replace, um hi. No, I want you to delete high and leave their as is now. How do you go? Move around inside off the file. And you're already India editor. You could use up bottom left, right keys on your keyboard to move around. But remember, you cannot use thes keys if you are an insert mode. So let's say if you are hit I and you know in insert more and now you do a left right key. It can work, but it most likely it will break your command. So it's better you had escaped and go back and then you do d on your keyboard d This will delete the entire line I wanted to delete on Lee the Ford High. So how do I get back? My last line that I deleted. So you hit you just simple you and it brings back your last line. Now, if you wanted to remove the high just type X once which will remove one character Type X again was to remove another character. Now you have a space hit X again. Now you don't have a space Now what? If you want to save now again, do shift ZZ twice and it saves it. How do you wear a fight? You do, cat my 1st 5 And it is there. Now let's go back in again. And let's practice the replace command the I my first Well, I wanted to replace. I am so excited about it. I wanted to replace the word excited with the word happy. So how do we do it? We cannot hit I right now because we don't want to get into the insert mode. So we will use our arrow keys to go down to the word excited so I could do our once I hit our I could do h It only replaced one letter if I wanted to do again. The second letter You move your cursor to the right it are and then do a and so forth. But I would prefer that you do escape out of it and then do x x x expects and then you hit I and then PP why you escape again. So you can move around, You could go up. It could go it down If you want to move around now, if What If you want to go to the end of this file and now you want to create a new line right below it before I am so happy about it. You had Oh, this will create a new line for you. And also, it would automatically put you into insert mode so you could type anything like LA Law. The law? Well, you just noticed that you just type j by mistake. Now, how do you remove Jay? You type X, Remember, If you're gonna type X, it will write X instead of deleting it. Look, See it typing the X So I want to delete that character. How do I delete that, captain is because you cannot delete why? Because you are in insert mold. How do I get out of insert more You hit? You're saving life saving key which is escape as soon as you hit escape. You see, the insert mode is gone. Now when you hit x x, it deletes those two characters that you added by mistake. It was a typo that you added Same way. If you want to go up, you could if you wanted to write something right here. And if you type, I you notice it. Start writing right in the middle. Hello. Hi C without giving a space. So let's do escape again. His ex Move the cursor to the left and x Okay. And now you have that space in the middle. Now, how do I write? By putting a space in the middle? I do a so able automatically advance to the next space. So hello. Hi. By space world. Okay. Now you still insert more. What? If you want to save it before you save it again, get out off Uncertain. More beheading escape and do shift z z this safe cure while cat My first, uh, and it is saving your first file now. What if I wanted to delete the line blah, blah, blah the third line. So I'll go back into my file, be I my first file. Move your cursor down to blah, blah, blah and hit d d twice. 12 They It removes the line that you added that wherever you want to go, if you want to. Oh, usual Moved it by mistake. No problem that you will bring it back again. You could save it through ships. Easy for you could save it through common right, Quit and bank. You could hit and and that's how you saved the ball. Now let's go back into the fall one more time. The I might first file and I want to. Let's say I have a file which is huge, and I wanted to search for a Pacific word in a file. Let's say I wanted to search for a lesson. I wanted to search for l so you could do search for it two ways. I hope you remember the command corrupt. And then you search for lesson from where my first file and it will Onley bring that one line that has the word lesson. But if you are in the eye mode, you could also do that same search. And now you could just simply make sure you're not an insert mode. Simply hit slash and type L E s s on lesson it into and there it will bring you to exactly the word that you want to change. Perhaps. Are you looking for so These are the few commands that we have about creating a file using the I. We do have many different commands or keys that we could use in V I I have included in this lecture. I have included all those keys in and Azan Handout. So please look into those and try every single key. I really want you to be very familiar with this and become eventually become an exporter venue typing in something in your text fall. You know exactly which key you're gonna work into or which exactly key you gonna use. Ah, one common mistake that everybody is gonna make is when you are an insert mode, you're probably gonna have to get out of it. You can. You typing ex this and that. But you cannot. So your lifesaver is You do colon. No. First Sorry. First his escape. Colon que Now this time don't write w the w will write your changes. The file. You don't want to make change it. So just to quit cold and quit bang, hit, enter verify it. They go See now you don't have that garbage that you were gonna write your file into. So this is another way. You get out and change your father. So please practice man also give you different options to use it. There's again. There's another editor if you like to use, which is them which, um, Anat vast version off the I. You could use that to, which is also available. Most of the links distribution, whichever you like, But please do practice practice as much as you can. And I will recommend that you create files many files in your home directories or within your subdirectories creature files and write whatever you want to ABC or write a story or whatever and change your text. This is this is gonna allow you to practice v i editor. 28. User Account Management: Hello, everyone, and welcome to a new lesson. User account management. In this lesson, we will learn how can be manage user account and Lennox in Lenox file system. There are, ah, few commands that we use to manage user account. The 1st 1 is user at is to create a new user group add to create a new group, use a delete delete, delete a user that is already created, group the lead to delete it group and use Ahmad, which is to modify a user. No. Whenever we create ah, a new user, those user management are created. Their record is maintained in three different files. The 1st 1 is at sea password 2nd 1 is at Sea Group and the 3rd 1 is at sea shadow. Now remember, etc. Password is not a complete word. Password is just past wt example. To run. A user command, which includes all the parameters that you have to define, is has fallen, goes with user add minus even option to add a group minus. As to option two. Give ah shell environment minus C to define the user description minus M minus T to define the user's home directory and the use itself and their use a home director itself and the name of the user. Now let's look at our Lennox machine and you'll practice thes commands and learn these command mawr into detail of log in to, uh, my Lennox, um Horschel Council. It's more this little to the side. So we could see what are the command that we will be using? Okay. Um, always first thing first. You need to find out who you are. You yourself, are you. You are in your home directory. Perfect. And what's inside of your home directory just to confirm you are in the right place. Yes, you are. When you have confirmed this just to clear screen, Um, now we gonna create a user call. Ah, that's a Spiderman. Before I create a user, I wanted to add that user to a group. Um, that is let's call it superheroes. So in orderto use thes command, you have to be route, so become route as she space by stash. Okay. The first command that we will run is user bad space. Spider Man, You hit. Enter. It gives you the prompt back, which means it did create. You are use your Spiderman. How do we verify if the if the user is created? There's a command to check if users create is called I D. It's fighter men and I'll tell you that there's idea signed to the users by the man, and the group is created called Spiderman and the group's I deeds so on. You could also verify about going to the home directory, So home if you notice that it created right here the Spiderman, the next command that we want to learn. Aziz Group AD. I wanted to create a group, a new group, to come on the command to that a new group, this group bad and I wanted to name it superheroes. It adds a group. Um, we could verified by looking at the group file, which will cover in a little little bit. But if you wanted to see if you could just a cat at sea groups and at the bottom, you'll see it created this group named superheroes. Now I want to delete the user I created Spiderman to the command to delete is user delete. Now, if you want to delete the home directory off Spiderman, which is right here you run the command user delete, but minds are as well. So it would delete the the directory as well. So it deleted the user. And let's check if it deleted the home directory. Yes, it did delete the home directory as well. So believe that I created and ah user before just called Spider just for testing purposes. As you could see it here, the next commander you have to do is, of course, the group delete. So let's try to delete the group. Uh, that's not the lead. Our group, your superheroes were created New group and with the leader just for training purposes. Let's create group bad. Um, known you good. Let's call us in your group that compares Created We verified by going to profile and see the bottom says no new group. That's new group idea. We could delete the new no new group group, delete no new So and it's deleted. We could verify again at the bottom. See, it's gone. The next commander we have to learn is user mod. This command is used to modify the users. You go run, man on. Use Ahmad to see what it does it modifies as user account. If you notice a appends it as a user to supplementary group, see the new Value User Password D changed the home directory. So these other things, if you want to do after you create ah user so we will use this command to ad our user Spider Spiderman. Let's see if he have Spider Man first or we delete aspirants. So let's create despite men again. User, add Spiderman As soon as you add the user user at Spiderman, it automatically creates its group as well. If you don't specify, it creates a group with the same name as user ID's. Now I wanted to add Spider Man to a different group as well, which is a superhero. So how do we do that? User mod minus G, which was the name of the group Super Heroes and the name off the user that I want to add a Spiderman enter and it is added. How do we verify it? You do cat at sea, but instead of doing the cat and viewing the whole file, huh? Bobby used group command and just type Spider Man from at Sea Group oil and a go, you will see, this is the Super User Group, and Spiderman is also part of that group. This is the Spire Man's own group Name an own group I D. So it Spider Man has its own group, and it's also belongs to a group called Superheroes as well. If you notice one here when you do Alice myself to your the group of Spiderman right here is still Spider Man. Why didn't change to suit superheroes? Because it's actual group as Spiderman, but always remains biderman. It is part off the other group as well, which is super heroes. If you want this to change, then you have to run the command change group and then you specify superheroes and then you specify Spider Men. And remember, we have to use minus our option to cascade this permission off the group to every folder off the Spiderman. So let's run this command. And now see if a changes from Spider Man is superheroes. Yes. See, now the user Spider Man, the group of superheroes. So that's how you use these five different commands. User add user group at use it Elite group delete. And he was a modification. And the files that it creates this information is, is the 1st 1 is etc. Password. Let's look at the etc password Cat at sea password and you'll see at the bottom as you add a new user to the Lenox system. It adds the information of the user at the bottom that pens at the bomb Spiderman and despite ER, the one I created earlier both heart in there. The first column tells you the name. The 2nd 1 tells you the password, which is encrypted. It's just give you the X 2nd 1 tell you the user i d. And then the group I D. And right here in between these two Coghlan's. We didn't specify the description, so it's empty. And then here it's a home directory of the Spider Man. And then at the end, it's the shell, the Spider Man it's using. So that's the description off the etc. Password. Let's look at the description off at Si Group, the Nazi group you have. The first is group group by name and then the group password, which is the same password that is used for anyone within that group and then the Group I d . The last column that you see here for the few off them, that means that these other users are also pour off the group. Then the last file will look at is a sensi shadow. Let's see Shadow, while is strictly for passwords off users that we create. This does not mean the password right here, right here is actually password. It's just encrypted, so we don't see it. However, it does have some other parameters, like the password does not expire. And these many days their password lent restrictions and so on. You could view that in man command, off creating uses, you'll get more information about etc. Shadow far again If you are Pacific above one user, let's say you just want to know the information about Spiderman in at Sea Password. You do script. It's biderman at sea Password, and you will only get the information about your matching criteria, which is Spiderman line. Now we look at the last example, which is the example that is mostly used in the corporate environment that they were run one big command that will take you off all parameters, so that's creating a new your user ad minus G to specify the group, which is we already have a group, Super heroes. And it's look at on its minimize. This city could move up and view our command. Okay. Okay. Superheroes minus s means the shell that you want to give. They're different shells. There been bashed corn shell will cover that later. Minus C is the description. You have to specify the description. Superheroes you want to create Iron Mental, Byron man care. They're just a description. Anything more than that, then minus m minus D and specify the Home Directory, which is home Byron Man Space Byron Men. This will create a user iron man with all the parameters we have specified. And how do you verify your just to I d men? And you'll see that Iron Man is there is part of the group superheroes and you could also view it in NC password file on you see at the bottom it's there now, one thing that we do have to cover. Every time you have to create a user, make sure you create its password. So the command to create a password it's just simple password Byron, man. And to specify the password and the password that have specified it says password feels the dictionary check. It is based on a dictionary. Um, you could ignore that as long as you're running as root. But if you're not rooted in, it's gonna force you to change the password that is not based on dictionary. But again, you're route. You could do anything. So this concludes our lesson for user account management. Um, the main the basic commands are these five commands and files that are used to manages is etc. Pastor Group in Shadow. 29. Switch Users and Sudo: since we know how to manage his account now it's time to learn about how do we switch users and how to be allows suitable access to user. What is a pseudo access? It's basically ah, command which allows are an ordinary user to run root level commands. The commands that you go on to such from one user to another is simply s you. It's based Dash based is using name and then it will ask you for the user name password you into that and you become that user. Next comment is the Sioux do command. This is how you run the command if you do not have root privileges or you cannot become route But you still need to run certain commands than you were on pseudo, followed by the command And then the last command is V I sue Do be I pseudo edits the ETS etc. Suit war file which is a configuration file that allows user to add or remove the rights to run certain commands. And the file is at sea. Sueur, Um, if you remember the beginning, we talked about file structure and be talked about the etc again at sea is the is the folder or a directory in Lenox where all the configuration files are stored. Now, let's look at these commands one white one by logging into our Lennox machine. And this time you will log into our Lennox machine through the party. First, we need to find out what is the I P address off our legs machine? If he don't know, just log in. Um, clear this out and the command to check the I P. Address off your lending machine is if config you had enter and the I P address is right here. This This is the primary interface that is used to communicate with the computers. This is the local interface. You ignore that and this is another individual ignored. That is for private communication. So focus on this one. Open up your plate terminal and type in the I P. Address. One I to 1 68 $56.101 Enter put in the user name isn't password. Once we're logged. And because simply minimize this Kancil ex ists now we will be using the putty. Make this a little bigger. Okay, so, um, we logged in as herself Now What if he wanted to become, um, another user? So you do s you dash Spiderman. I will ask you for the password and then you become Spiderman. Let's exit. I'll go back to our account. What if you want to become root simply to s you dash which we have covered many times into the past Word and you become brute when you are route. And from this level, you wanted to switch to a different user. This is vitamin. Then it will not ask you for the password. Because super user, a root account is very powerful. That does not need any other password to be authenticated. We are your Spiderman. Let's go back. We are now route that school One step back, exit out and we are your horse ill. Let's clear this out. Next command, you'll learn a pseudo sudo is The commander is used to run different commands that is, Onley owned or only has permissions by route to run them. For example one of the command his d m. I decode you were on that that will give you permission denied because we cannot run that command. Another command would be, for example, F disk to chest. Check the disc size. It will give you the permission denied as well. Because we do not have the right again. Who am I? Your ourselves. So how do we get the permission without becoming looked? While only route can allow that I could become route here and run the command Till s you to root and it and to know I'm route and the commanded of Iran to add a group to at sea Suroor file is V I s C zoo for hair. You need to look for the group named Veal. Veal is the group that is automatically by default Added to this file, We go down, we're coming down. Remember to come down When you are in V I mode, you come down, you use your upkeep, right? Keep bottom key and they go said This is the veal and it tells you this group allows people in group real to run all commands. So all we need to do is to add I have solved into the veal group and it will allow all users who ever in real group to run all commands. So it's already added there. We don't have to modify the etc suit. Or if you wanted to add a new group or if you want to add a new user, then you would change that to allow run all the commands. Let's say if you want, if you want to add, I absolved to run all youse a command. Then you would put it right here. Who put? I have solved, uh, that oh tap. And then you run pseudo command and you could become route, uh, rights to run any command. But we don't want to go at the user level. We want we will stay at the group level. So what I'll do, I'll delete this line to delete a line is DD and then save the pile. Now we know that we need to add user to feel groups to add a user issues ERM odd minus G and the command is the rich group is veal and the user is so enter. How do you verify your group deal from that's he grew up because group is the file. The man just that user manages all the groups and you'll see right here. Now I am part off the group real so if I become myself at sea absolved my myself. So if I become myself now, if I run Sue d m. I decode it will ask me for the first time Password. Um Okay, so the command that I typed was wrong, so d m by not d e m. I decode. Sorry about that. There you go. See? No, the command is running. What if you run this command just fiddle, Sue, it's not gonna run. You have to run the command pseudo followed by the d M I. D. Code. And that's how it will run. You can also run the second command Sue do, um F disc, which will tell you the size of your disk. And here it will tell you your size of the disk is 10.7 gig and all the petition information all that. You can only view that information on lee if you're route. So this is how we do switch user from one user to another and be at a user to become a powerful user or run powerful command that Onley owned by route 30. System Utility Commands: system utility commands. These are very basic commands, um, that are being used in Lenox environment. Some off Those commands are just like and Windows. We have time. You have a calendar. Now Windows is a qui environment. You could view those time and calculators and stuff like that by going to the accessories, but in Lenox, it's not possible. So so that's why they are commands that are being built to tell you to the date. The up time information. The host name the You name the about the operating system, which means where the commands are located. Their calculators Sorry, the calendar and the B C is binary calculators. Now let's look at our Lennox machine and run these commands one by one Lennox machine. When you logged into the going to the council, you'll see the time here. You also have the option to go into the applications and pull up a calendar, and you see all information that are automatically viewed. Um Vidal running any command. But what if you are logging in through the party or the terminal client? And as I said before 98% of the time, you will be logging in to the party client to the terminal where you're not gonna be able to see all those qui environment. So let's look at the view through the party again. We will put in our I P addresses 1 90 to 1 68 $56.1 a one and I remembered by now. And if you don't, you just simply go back to your consul and type. If config enter and the top right here, this is the I P address. You punching that I p address right hair and click on open terminal A little pin up your log in as yourself put in the past and you are locked in. Once you clear the screen and you will see here there is nothing but the black terminal. So and you wanted to run when you wanted to find out. What time is it or what dated it? It is just type date. Tell you. Today is Tuesday, March 13th the time and the seconds and Eastern daylight saving time and the year. So that's what the date command is used for. It's very simple, and sometimes that they commend is used to combine with the script. So script will wake up checks the date and it will run. Certain scripts will cover that in our scripting session. Ah, the next one is up. Time up. Time simply tells you along Been the system up for and how Maney users have been logged into the system and the load average the next one. It tells us about the host name. Uh, right here the host name. Let's move this little to the side. First name. We could go back to our council. They could do the coast name and you'll see this is the host name off our links machine. And host name is one of the important command that I would recommend you to run every time you log into the system shoe. So you would know you are not logging in to the wrong system and you're not running very critical commands on the wrong system. Clear the screen. The next one we have you name and you type you name. It would tell you it's a little machine again. The Lennox machine. You do need to run this command because sometimes in an environmentally have Lennox you have Solaris. You have X many different links uh, UNIX flavours. So it's good to run your name if you want to know more details about you. Name you type you name minus a Ever give you a lot more detail than just let me give you the host named the kernel version the time it was built and other architecture information . The next command we need to learn is which Which command tells you the location off your command that you run. Let's say you run the command PWD right? Andi tells you that the command is telling you which director you are in. So where is that command located? Of course. Every command is a file itself and is located located somewhere to find out your type which pwd And it tells you this command PWD is located and user Ben P W d. If you want to know more attributes about this command, you're on ls minus l user been pwd and you will see right here. This is the script. Actually, the command itself is a script. The script itself is a text file that has been written by developers and it tells you right here it is owned by route and the group is owned by a route and that these are the permissions off this file. Everybody has the right to execute it. If I take this bit out than I cannot run or nobody else can run this command. So this is what which command does? Let's clear this out. If you want to know where is date command located it. Command is also located, and use have been date. So as you can see, most of the commands are located in user. Been, you do ls minus l. And you see whole bunch off commands. If you want to view one page at a time, you could do more. And you could see all these commands that we have there. A bunch of commands that Lennox has. What if I wanted to know how many total commands are in lyrics? Very simple. You do? Ls minus l. And if you remember you, Piper, you do board count minus tell. This would gives me the total number of all these lines. That coming up is telling me there are 597 commands that are inside off this next machine. Moving on. Um what if I wanted to know the calendar. If I just typed Cal, it was Give me the calendar off this month and this year. Ah, what if I wanted to know the month when I was born? Let's say, for for training of Do Cal September 18 1977 salt type Sept. 99 start September which is the month 1977 and it will give me. I could look at its Sept 18 Waas Sunday so you could type any a month followed by the calendar. If you just wanted to know all the months in the year 2016. So you just have Cal to down 60 and I'll give you all those months, uh, starting with, of course, January ending in December. That's what the cow of command is used for. Next Commander, you have as clear in this B. C. B. C stands for binary calculator. If you want to do the calculation, of course, you could go in here and bring the calculator, but you don't want to bring the country and going more. You are in terminal mode, so you want to use a calculator than what you do. You type again. BC it enter No if you wanted to, Plus to enter and give you four. What it 2 56 times. Greed 21. That's the answer. So this is this the basic calculator You could do division, multiplication, anything that you want. If you want to quit out if it just type, quit and you will be at If it's that these air a fuse system utility commands, Um, and you could run that these are fun commands. Come up with the different options. Enough great, of course, to look at the options you could do man on every command and run with few. 31. Processes and Jobs: processes and jobs. Before we get into this lesson, I want you to understand what exactly each term means in Lenox environment. Well, first, we have applications, but you are also a four to a service on application or service is like a program that runs in your computer, and then application could be anything like in Windows. You have Microsoft Word Power Point, and then it's You have programs or applications like NTP, NFS, Apache and whole bunch of different programs. So that is an application and service that runs on your computer. Then you have a script. What exactly a script is. A script is something that is written in a file and then packaged it to in a way that it will execute. So any application that is running in your computer, for example, a podgy you would have to run that as a script, and that will run in the background. So that's actually a script, and also all those different commands that we run in our Lennox environment. All of them are also refer to a script. Then we have a process. What is a process when you run an application or when you start up an application. It actually generates process. With this process, I d. Now processes could be one associated to that application, or it could be multiple processes. Then we have Damon. The demon is, I could tell you when I compare it with the process is something that continuously runs in the background or doesn't stops. So when you run a Damon, which is also process, but it keeps on running the background and it keeps listening to the incoming traffic or outgoing traffic, then there is a thread or threads. Every process could have multiple threads associated with it, an application that is running in your background. Let's say an F s. When you run that application in your next machine, it could have many multiple threats. If a machine a remote machine, tried to connect to you through an FS, it will generate one threat for it, and it will generate a second threat or third threat for other computers at attaching to it . Then we have a job. A job is something that is created by scheduler, like a work order to run those application and services in process and service commands. We have a first command this system. CTL This command is now used in Red Hat seven and it is being replaced. Sorry There. The old command that was running in all your version off Red Hat or Cento as its service service is now being replaced with a newer command system, CTL Then we have a P s command. This command allows you to see what are the process is running in your Lennox system. You could used different options with that to find out exactly the process that you are looking for. Then you have a top command. Now, when you run the top command, you will see all your processes running in your system, depending on which process you want to see first based on its load. And it also tells use your memory information, CPU information that is being used by that process. Then we have a kill command. The kill command kills the process. It kills by the process, name or kills by the process. I d. So when you start an application again going back to our example of Apache when you run an application, Http which associated with Apache it has a process. I d to it. You could stop that process by running system. CTL Stop http. D or you could simply kill followed by the process, Name or process. I d will cover kill command later in this lesson. And we have Cron Tell Cron TAP command is used to schedule these. These applications are these process or D services for you In your system, you run Cron tabs minus E to edit it and there are different options of all cover with the Krahn tab. So when that Cron tab in that, uh, process or application is scheduled in contact, that becomes a job and the last Commander will koa is act at command is just like Cron Tabs on Lee Difference between At and Cron Tap is at a schedule as one time basis or as an add a hawk process. We'll look into our Lennox machine and will go or the processes and some of those commands that's locking our screen CD check where we are. We are And what is the host Ning Good. Clear all these commands that we will be running Most of these commands need route. The village is so we could either become route on this terminal or you could use a ferry terminal, whichever the terminal that you before. For this, we will stay on the console, so become route. Okay, Um, let's clear this out. Now. System C t l is the command to start an application or stop an application. It also is the command that is used to list or sorry to enable an application to start or stop at the boot time. Meaning every time of your computer starts up, you need certain applications to run. So to start on application that, say, I wanted to start an application call NTP. NTP is a Damon that runs all the time but stands for network time protocol, which syncs your time to other clocks. So system see Thiel restart and T p d. The DVR putting into because it telling it it's a demon you had enter and you get your prom back. The reason you get your prom bags because it did start it. That and P service. Now, how do we check if that services running? You do p this and the option that I used my favorite is Hi pin or dash E f. You could use other options. Here's my ZF you hit? Enter When you hit enter, you're going to see all bunch of processes that are running in your system. Do you really want to look into all these processes? No. You are looking for only one process which you just started. So you do PS minus cf Pipe it corrupt it and t p d. And it will tell you yes, the process is running or the application is running. That's right here. You could also use the same command system CTL Status Command to view if the process is running. They're tells you right here that never time protocol. That's a service. And it's loaded and it's active and it's running. And it's running since the time and it gives you a lot of foot. Other details Now what if you wanted to stop this process, you could do a system C t ill stop anti PD and it stopped. See if it still exists. PS minus Lee, If I grew up aunty P. D. It does not exist if it doesn't exist and why we are getting this line. Well, if you pay very close attention, this is telling you that the command that you just ran PS minus e f. When you run this the Linux system, the opening system is so fast and so sure that it gets you the same command that you running. You see, it's giving you the script that I ran this group and if and descript is also considered as a process itself within itself. So that's why it's giving you. You always going to get this grip it whenever you run this gripped command. So this is about P s system CTL command. And if you want to enable an application, you could just thrown system CTL enable and t p d. And this will enable seats is created symbolic link. It has created symbolic link in in the etc configuration file. So now every time my computer, my linens machine is going to start, it will start the NTP demon with it. Another example of different process is send mail or RCIs log. Let's see horses log is another application or process their runs, which collects your locks. So let's see if it's running. Yes, you see it is running, and if you wanted to check the status, you could also do to some CTL status our CIS log and it will tell you this active. Then it is running. So that's how you find out about all the processes. Now, what if you want to kill that process? Um, sorry. Let's take one step back and we'll run. Top command Top Command is one of the favorite command for many system administrators because, um, this will tell you about the system. Resource is also one of the favourite question by an interviewer who was going to interview you. They will ask you Tell me about how do you monitor the system? This is where you could tell them. You run the top command and the top command will give you There are total number off total task 171 is running one in 69 Sleeping. What? The CPU usage Is it too high? Is a too low. What is the memory usage? What Issa Swaths based. And then right here it is listing every process that is running in our Lennox environment with the process I d. Who the user is and what is the memory being used? What is the CPI of being used? How long is it running for and What is the command association associated with that process ? So this has so much information that I cannot co were in this lecture, so I would encourage you to do is do man on it or read a lot more about it in different documentation. I will also include some documentation that will explain top command and detail. You could also feel free to Google it. You could view top, but you should spend some time quite a bit time to look into the output of this command. Now what if you wanted to get out off it? This simply type Q. Wants your type Cube. You will get your problem back Now we'll go to the command kill If you remember, we used PS minus e f to check which processes are running quip And I wanted to, uh to NTP de NTP is not running. Let's start it first. So we'll do, uh, system CTL restart or start doesn't matter. And TPD it has started. Let's check again. PS minus CF Group and TPD. It is running now. I wanted to kill this process. There are two ways to do it. One is if you do, um, system see Thiel and do stop this command. Or you could simply do kill, kill will kill the process regardless off that is gonna go down gracefully or not. So which process we gonna kill right here? This is a process I d so kill simply. 120 to seventh the process I d enter now let's verify if it killed it. Yes, See, it's gone because we are killing the process i d the same way which ever process that you have. You could just do kill a PS minus cf and then more Because you want to see all the process of tons of processes that are running on your system. Any process that is young, you could kill it. And how do you know it is hung? You could type top command and you will see here under memory or CPU if any of the processes using that's in 99% of CPU or 99% of memory. That's definitely one of the candidates to use the kill command to kill it to free up. The resource is system administrators use this commend many times to keep their system up and running and healthy. Next we will learn Cron tab. Let's exit out and we will become ourselves. Cron tab allows you to schedule. Oh, are scripts are our commands which everywhere you want to schedule. So let's say I want to schedule to create a file that has some kind of upward at a certain time. First, let's check the date. My date is Tuesday. Wash their team 12. 19. This clock is one hour off. I want to set this clock first have become route sit this clock and I'll due date minds as to set. And it will be, I think I have it said here. Yes, it will be their teen March $2.18 um, the hour time the second and hit enter and then you do date and it sets the correct eight. Now let's will go back to our self who my and we ourself play of the screen. Now let's do contact. Contact is a command self. You have to do quantum minus E to edit the content and specify whatever that you're trying to schedule. Enter the first once you run. Sorry. Once you were in contact minus e, it will bring you to a V i editor mode the same as if you're on bi. I followed by the fire lane. So you were in their head I to insert the 1st 1 is the minute. So we want to scare you something At 22 2nd 1 hour 13 then the day of the month off. Put every day which it has direct month is three, which is march. They have the vehicle do every day. Okay, so we schedule the time now. What do we want to do? We want to do Echo. This is my first Kron tab entry, and I wanted to put that to a file Cron Teoh bash file. Oh, Cron tab entry. So if you notice that the time has quickly changed already become 1 22 So I'm just gonna change 23. It escaped, right? Quit and hit. Enter. Now the time is 21. It's still have 43. So the me just took quickly to said this would be Don't lose time. Date 53. Let's say, do we have the file created yet? Yet? This is the 1st 1 I had it before. That's flying date 22. Perfect. So let's see did it created? There you go. My first file. Sorry. Not my first fire. It's my cell tr Cron tabs entry because we are doing contact unless l it created Cron tab entry in the contest entry is Cat Ron Temer's entry. This is my first Cron tap. So it did create it so But it created itself, so I schedule it. That's why it created, um to do a quick comparison off our commands that we learn with our Windows environment is the 1st 1 system CTL When you when you and your Windows environment right click on your start Task Manager. You see all these applications? These are the application you could stop and start using the system CTL in Lenox. These air the processes that run that associated with all those processes. And many of them are Damon processes like service host, host process for Windows. Many of these run as the process. These air the services that you could shut down with system CTL on the performance. Remember, we ran the top command. The top command tells you about your CPU memory. Exactly. This is what you're looking at. The when the vendors task manager on this one gives you the never accuse it and, of course, the use itself. So this is a quick comparison between Windows and Lennox, and I hope you will run all these commands one by one to learn more about them. 32. System Maintenance Commands: next lesson we have is about system maintenance commands. Maintenance commands are those that are used by system administrator to reward system, shut it down or bring it single mode or whatever the task they have to perform while others is. Other users are logged in or happen, lock off and then bring it to the single use a mode. The commands that are used to bring down Olynyk system is shut down in it now, and it has a different level off bringing the system down or rebuilding. It goes anywhere from 0 to 70 for simply shut down and six is to reboot and three is to bring it in in multi use M O. And there are many other options. Then we have a reboot command at its raids. Reboot is simply to reboot your linens machine, and then we have hauled command halt shuts down the computer, and if there are any processes that are running that needs some time to bring down other process, halt doesn't care. It just shuts down right away. It is as if you are pressing the button on your physical system, the power button and holding it, empowering it down. It's just like that. So now let's get into our Lennox lab server and you will try out few of these commands. I belong into the Lennox machine. By logging into the party. I'll open it up, log in myself and, of course who you are. You are self fish directly we are in. And which hosts are we on? Because every time you're ready to report the machine, this is definitely a command You need to run, which is host name to make sure which computer you are, on which lens machine you are. All So anyway, let's clear this screen and the first command is shut down. Of course, I don't want to shut down this machine right now because we're going to the training soldiers Quickly go through the man page of shutdown and you will see it tells you shut down halls power off reboot. The machine shutdown has different options. If you want to use thes different option with it and those options are listed as you go down. If you type shutdown minus upper case H, it will do exactly the same as if you would just type halt and people power off our for reboot age for equal into power off on this whole time specified. So you could view every single options that is available with shudder. Then we have the next one is in it, and it is assistant D service. There are different options associated with in it. Sorry with, uh, yes, but in it and those options, you could view them one by one. As a zay said, there are options 0 to 7. You could view those options and see what exactly they do. Then we have reboot. Um, reboot simply reboots your computer, shuts it down and power off and bring it back online. And the last one you have halt power off reboot hold power off. So pretty much all these commands, you could use any one of these commands except the reboot command and in it command. So let's say now we want to reboot our machine. In order to reboot your machine, you have to be route, so become route. And if I do reboot this center and you will see I have lost my putty session. And if you are logged into your consul, you'll see the system messages coming up. This system is going down, so we'll give it some time. I will. Fast forward from here. Okay, so now I got the prom back. This system has been rebooted. Like a log back in your party terminal will continue to try to connect to your system. If it's showdown, tries to connect it every second or every five second, depending on the setting that you have specified and you're putty options. So anyway, this is sweet and simple and straightforward lesson that we learn about four commands. Try them out and get familiar with it. 33. System Monitoring Commands: system monitoring. Now we're getting deep into the system. Administration type off commands are the roles that you will be working on. If you really want to get a job and system administration, our systems engineering or Lennox related field, you do need to know all those system monitor commands. Some of them are top DF, The message i O stat Nets Dead Pre and CPU info and memory information. All these commands of list all the system resource is animals of Tell you how the systems is doing. How is it behaving whether it's running high or low. So let's look at them one by one by logging into our ranks machine log into our, um, VM Consul, the top command you could run without being route. So, um, if you notice in the top command once again it has CPU information, memory information. It tells you which process it's on, which users running on what command it's running. This is again one very powerful command, and you should really spend some time to look into every field. Andi, I will, uh, I would highly recommend you to go look for the documentation or Google it and find out more information about it if you want to get out of it. Cute. The next one we have DF DF gives you your disk petition information. You could run DF minus a man space DF, it tells you report while system disk usage Well, Ron DF again and it tells you the false system is mapped right here. It has this block. This is available. What percent is used now? The most common options that is used with DF is minus gauge. Age is easier. Is human readable. It's easy to understand. So now it tells you we have a disc size actor. Root level, which is eight gig and 3.4 giggles used and 4.6 is available and uses 43%. Also give Ian percentage. And so on is the memory, which is about two gig. And then we have a boot file system, which, when the system boots, everything is located in what to boot, which filed suit boot. Um, it has one gig and so one gig here. Eight Gig care. So nine gig and this, um, free memory, which is the swap or virtual memories about one gig that makes it 10 games. And if you remember, we created our virtual machine with 10 gig. And that's what it's telling you. The petition information, if your system is dead, has crashed. Um, one of the things you should look into it is DF minus H output once again DF minus h. And if the usage right here says 100% or any of the usage says 100% then definitely you are in trouble and you need to free up your dis space. And you need to find out how to free up this space. You need another command. That is you. Sorry, Do you? You could do man on, do you and learn more about it. It tells you the estimated file space usage. Which file is taking up all the space next command we have de message de message gives you the output off the system related warnings ever messages, failures or anything like that. And you run it? Of course. It throws a bunch off error messages, a bunch of information at you. And if you want to view that one page at a time, what do you do? You pipe it to more and you pipe it. Tomb or you will see it gives you the bios information. What? When the system initialized how it went to what? CPU. If there is any issues with the memory, it will report you right here if there is a memory leak. If there's issue with CPU, that's crashed Mother board. Issue anything related to your system, hardware will be listed here, and this is again one of the good things that you should look at if you are in system administration. If you are going for interview, the interview is gonna ask you give me the commands that use used to monitor your system. These are the commands. You shall list them right away. And I'm telling you, he or she will be impressed right away that you know your command. You know your system administration skills. The next command will learn is I o stat. I owe this stands for input and output statistics. What could what's coming in? What's going out? How we are communicating with our system, peripheral devices or system internal devices, even if it's a disk or network. When you run it, it's gonna give you the information right away that the disk is being used with the read per second right per second and a lot of different information. You could also run i o stat with space One which is telling it to refresh. Keep running it. But refresh it, everyone. Second said refresher refresher. Keep telling you, keep updating you to read and write. If it is doing any reading right, it will update it as it goes. You could quit out if it by simply typing. I think you have to do control. See to quit out of it. The next one we have Nets, stat. That's dead. Minds are envy is the option that I mostly used. If I want to find out my gateway information if I wanted to find out my subject mask and what interface it is going through, this is command apple juice. Um, there are other options that you could use with net stack just next at interview. Pipe it and you do mawr. You're gonna see a lot of information. What is connected to your system, what has been disconnected. Ah, what's the process? I d which processes it running and and the the name off the owner off the process so it does give you all the information once again, I apologize. I cannot cover every single detail. If I cover it, it's gonna take me hours and hours and days and days to do to cover every single command till I will. Um, my recommendation is to you is just so simply, man, Nets stack and you look into the description off this command and the option of this command. Now, please do remember, I've been doing the Lennox for a very long time. And trust me, I myself don't know every single options that a command has to offer. If I wanted to find out or if I wanted to look for a Pacific output, then yes, Then I will look into the options that is available. But it's completely understandable that not every person would needs to remember every command or every option associated with every command. The next command we have free free gives you the your physical memory and your swap space, which is a virtual memory utilization. Just sue usage and free. The next one we have. His cat cat is to read the file off CPU info. Every time your computer is started, it keeps all its system. Resource is information into files, and those files are located in Prak. This Prock is the directory where keeps us all system information so you could just do simply cat product info CPU and four. You will find your CPU information right here. If you want to know your memory information, you could do proxies system memory in full. Of course, it's throwing all the messages a lot. That's green multiple one chart, so you could just do simply pipe it and more it, in your view it one page at a time. So these are system monitoring commands. Um, you do need to remember these Pacific commands on top of your head if you are going for interview if you're going for a technical interview or even if you are a new to Linux environment and you want to learn more commands by monitoring the system, resource is you should look into these commands 34. Shell Scripting: shell scripting, Let's get into some fun. Yes, everyone, that's it's time to get into some fun, very going to create our own scripts, our own commands to run and automate tasks. So what is a shell script? So basically a shell script is an execute herbal file containing multiple shell commands that are executed sequentially. So and every time you create a shell and you create, you have a first command, followed by 2nd 3rd and fourth. Always the first command will be executed, followed by the second and third and so on. So the file off a shell contains the first thing. The first line is the shell itself always defined the shell with pound bank slash bin slash bash In Lenox. Most of the time, the exclamation point is referred to as bank. So the first line off a shell script is always start with the shell. It's gonna run in most of the scripts. Every will cover are all gonna be and back scripting. Then we inside off a shell script. We also have comments where you could tell what this command or what this script does. Every time you put comments, we always start with hash pound sign followed by all the comments everyone to add. Then we have commands. Of course. What, exactly you want the script to do. And then we also have the statements which will tell the script if then while or do a four loop or all those different conditions that we will cover one by one. And those are different. Shell script ing's a shell script should have execute herbal permission. What? It means that when you created a script, of course, a script is just an empty file. Everything in linen are is just filed a flat file until you change it to an execute herbal or link or just a flat file. So if you go back, Teoh ah, execute herbal permission. Um, learning that you had jewels, remember that the third bit in a file is always execute Herbal, which is X and on the group is X and on the others as X. So, in order for a script to run, it has to has this X bit on it. A shell script has to be called from absolute path. It always has your harvest have to define the complete path off the shell, meaning in this case like home, your user directory and the name of the script. If it is not in absolute path, you could still run it. If you are in the current location, that you all have to do is put a dot, slash and the name off your script. 35. Basic Shell Scripts: shell scripts and basic shows scripts, and that is fun, fun and nothing but the fund. That's where we're gonna actually do, right? The shell scripts. And we're gonna run very small share script to get you started. And you will have your own little shell script on little commands that you go run some of the shell script that ricotta is, uh, like out putting to the screen. Using eco command, we could create tasks such as telling, what is your i d? Your current locations of files and directories and some of your system information. Another way we could creative a script that will create your files or directors for you. And then we could also dio output to a file within your script. And we could use some off the text processor through scripts and some of those those text processes are like cut off, grew up sword unique. All those different type of commands that we run on a daily basis. We could automate them to see our to get our desire result. So I'm gonna get into my lyrics machine. I'm gonna find out the I P address on my machine, which is one I to 1 68 56 1 a one. And I'm gonna log in through a party session, which I already have safe. I could also type it in. Once I'm in. I could just simply log in and I could minimize this, and I could focus on my putty session. Okay. In putty session, the first thing we're gonna do is create a directory in our home directory. So are we in our home directory? Let's check PWD. It tells us we are in our home directory, so I'm gonna create a direct G, but didn't my home directory, and I'm gonna call it my scripts, and then I'm gonna go into my script. But first, let's verify if it created. Yes, it did. And then I'm gonna go into my script called Mice. Crips. What's inside? Of course, there's nothing inside. I haven't created any fault. So now I want to create a foot script. The first grip is to create his weather. You could touch a file and then v i. But since we have to write a script, we always started the I and I wanted to do. I wanted to specify the name that would be output. I'll put screen just that or any name that you decide to pick and you had enter. It will bring you to the V I mode you had I to insert. And if it is a script, you always start with hash bang slash been bash. This is defining that. You gonna run the script under bash Shell environment. Now what do we want it to do? Is rewired to display something on the screen. So to display something on the screen, you corona command, go and then you could type hello, world. And once you're done, you could just simply escape and right, Quit out of this file and the file is created. You could verify that it has a content that you just added by doing cat output. And it tells you that it does have all those contents that you put it inside off this file . Now, can I run this file by doing Ellis by doing dot, slash output screen? No, I can, because it's not even telling me that there is anything that exists like that. And it's selling me. It's permission denied. Why? Because we do not have execute herbal permissions to our output. Dax Green fall. So we have to give it executed Permission to all execute. I'll put screen and now do ls minus ntr. And you will see It also has shamed the color. And it has given execute herbal right to everyone. Now, if you run this command, you gonna see always run the command. If you are already inside of the directory, you could run the command by dot, slash and output and you run it. It gives you Hello, world. Hello, world. This is your first script. And if you have this, if you have created this grip I'm telling you, you are already at the initial stage off being a programmer. So pat yourself in the back and you should be proud that you could write a script and you could execute it. And it works perfectly. So this is one of the scripts that we did. Oh, by the way, we could also run the script from absolute Path, which is home. I have solved my scripts and output. Now, in this case, we don't need dot slash We could just run the script from its absolute path and it will give us the same output. Now, I also have some off the scripts that is saved or written in my word, Pat, I'm gonna bring that up, and I'm gonna review them to tell you how we could list the command so I could have simply copy and paste. So here's another script that will run commands for me. So I'm gonna do V. I run commands is just a name that I'm picking for a file. Once I do that, I hit, I insert, I go here, copy this, and I'm gonna pace that here. So what? It does the 1st 1 as you you should already know defines which shell you are in. You are in been bash. And that's where the script is gonna run. The next one tells you the description off this script. This defines small tasks, so I'm gonna run small task is distinct. Ah, Comment. If I wanted to write another comment is I could do this script is written by Imron absolute or goes to safe, uh, date that was written in 2018. First thing that the script is doing is doing Who am I? Who am I? Is a command that tells you who you are. Then it's running. Echo what Echo is doing at this point? It's only gonna give a break inside off your script. It's gonna give you a space. When you run this command, you're going to see the output has a space. Then the next command is going to run his P W d. Next command is gonna run. Host name next command. Is it gonna run? Is ls minus. Lt are. And now, at the end, let's to run the script. Save it. So run commands What? I cannot run it. Why? Again? I do not have executed herbal commissions, so I'm gonna assign execute permission. I'm well verified. Yes. No, I have it. Run. Come in. They're Ugo. Remember? The 1st 1 was, um I tells me my user name. Restore a tree. I'm in this a directory and host named. This is my host name. And unless my SLT are the number of files I have inside and the reason I put an echo in the middle so I could have these spaces, the empty lines, it will be easier for me to read it. So that's about getting the task done on our shell scripting using our show scripting Another way I'm gonna call one more script is to define variables. When you defined variables, it will run those variables to whatever the values I have defined. So I'm gonna create another script called the I Very Able Command again. It's just name of the file that I'm picking. I'm gonna going to insert mode. I'm gonna copy this. Then I'm gonna paste it inside. Okay, let's look at it. What? This come Script is doing the first. The first line of the scripts is basically again defining the shell. 2nd 1 is telling me what the script does now. This was selling me Eight is for Imron. B is for absolute C is for the next class Now it will echo is my first name is dollar A So what is dollar a right here? Variable imron, then echo. My surname is dollar be. What is Ellerbee right here is defined very about Absolute And the 3rd 1 is my surname is C Sorry I should change my surname to my class Is dollar see? And what is that? Next class. So now let's run this command. Save it And again don't forget to change the permissions to execute herbal and let's run variable command. It say's My first name is Imron. My surname is F salt, and my class is it didn't tell me the class. Why? Because, let's say says Line six class, this command now found what's inside of this. Let's look at the file. Why it didn't like it. Um, my class is Lennox class. It should say that. But if it is not good, let's try to get rid off these coats and then run it. My class is still didn't run. Let's try again. See, my class is because since I have a space, um, it's not liking it. Ah, let's see why my class is dollar see? Should have. Let's try a single coat and let's see if it works. Yep, There you go. It works. So this double code doesn't work. Single coat does. You might have to troubleshoot a little bit while you are creating your script. So I'm glad I have this problem. So this way you will know exactly when you when your script doesn't run how you could troubleshoot. You could tell by the error, and you could tell by the line that it would tell you exactly. Your script did not run because it has an error in Line six and the Line Six Wars. 123456 So that's how the shell scripting works. And I really hope by now you have created three scripts, and I really encourage you to go online. Find Shell Bish basic scripts that you could use and run in your environment and see how it works. 36. Shell history: shell history. What a shell history is every command that your run in your legs up ring system or in your terminal It creates a history of these commands. This history command, I'm telling you, is so useful that even when you're troubleshooting, you're trying to find out what other commands people ran that actually bring your brought your system down or crash your system Or what is the command that was wrong that deleted a file? All those commands that you run in, Lennox just be careful. Those commands are recorded and those commands are recorded and can be retrieved by simply running a history command. So it's just the street commandment. Everything is lower case. When you run it, you'll get all the listing off your commands That's been run by a Pacific user. Let's try to run it. I'm gonna log into my party, Citian, I am already in here. Um, where am I? Myself just confirmed which directory on men and which whole Steinman Awesome! We have confirmed that they are logged into the right systems now. I wanted to clear the screen and run this three command. Whoa! Such a long list of history commands what is telling me right here that I have? So far since I have logged into the system, I have ran the history command 666 times. These are the different commands I have ran since I logged in or since as many times I logged in. Since the system is built, how do you view other commands? Of course. If you're running putty, you could just scroll up. But what if you wanted to see all of them? One page at a time? Please tell me you know that history Pipe it More it? Yes. Now it's gonna start listing all the commands one by 11 by one. The first command when I logged into the system the very first time and I built a system was pwd next commanded it. Exit if conflict those are different commands is if you could see you could check every single command every day. You could also run this command in your shell and find out what other commands is listed. It's not only gonna list the command at that you ran successfully. It will also lets the command that you ran incorrectly or wrong command or command that did not work. So that's how the history command Waas now coolest feature of history Command, which even alone that if you wanted to run any off this command again, you could copy and paste. But you could do that. But there's a chance is it's not gonna get copied or it's not gonna get paste. But if you wanted to create, if you want to run a command again, let's say I wanted to pick a command. Um, I wanted to pick a commander. I wanted to run last last tell you which users are logged in an arc walk. It's gonna print out only the first column off the output last, and then it's going to sort it out, and it's gonna unique it out. Of course, it's a long command. There's two ways you could do. It is one you could copy paste, or you could just do four or six. Remember four or six that this command the number off this command was four or six, and then you run it. How do you run it? You just simply type Bank 406 richest force or six you run it into ran that command and give you the upload. That command isn't that cool, guys. It is very cool. I use it all the time. And I love this because this way, I don't remember a command that I typed maybe five months ago. If I go into a history, I look into it right away. And if you want to do history, command and you remember that you ran a command that had walk in it, you were looking for something that has organised. So what do you do? You just grateful walk and ever list all the commands that Iran that has walk inside off it . If you wanted to do history and grab and you want true, check all the commands that has changed modern it You get all those commands. So again, try it. Try it as many times as you want. And please always run man on history and you will find many information on a lot more options that you could use 37. Enabling Internet in Linux VM: getting Internet access to your virtual machine. Now in this module, we will co our different components off networking. We will learn little bit about how networking works in a Lennox environment. So before we get into the network, we do need to allow access to our Lennox machine. And in order to allow access, we have to make certain changes to our were actual worship box manager. Basically, we have to go to the network setting and change its network adapter to British adapter. So this way it will get its network through your laptop or your through your desktop. So let's go into right into on the change. This is our VM that is running. I want you to go to the setting network and change this attached to bridged adapter. Once you change it, leave everything default. Click OK, once it's sit, let's go to our courtroom machine and then here we will try to do Ping, uh ping dot google dot com And right now it's telling me that it has. The service is not available, so it's become route and then just simply reboot the machine in it. There to reboot is in it. Zero or just type, Simply reboot. It's open up the terminal, and this time I want you run Command If config and pipe it to more and you will see here, the I P address has changed. It is given the I P addresses off the same network that you have set up at your home. So now when you try to Pink www dot google dot com, you should get the response. See, it's getting to 64 bits. Response back from the server. Paying is the Commander is used to communicate to other servers. So now we know that our machine is ready. It's written on the on the network We could I don't know the packages. We could install the packages, anything that we want, it has ability to go on online. 38. Network Files and Commands: network files and command. There are many never Quiles and commands that needs to be used in order to configure your machine and bring it online and bring it to the network so it could communicate from one machine to another. It should have an interface, an interfaith detection. Assigning an I P address to the system is very important when you bring up a system and you need to have it on the network, the interface configuration files or the 1st 1 is XY and a switch Dakar File. This file is located in every Lennox distribution. In fact, all these fathers that I'm gonna talk about all of them are and will be in your Linux system. So for the 1st 1 is Anna switched out Comp, which tells the system where is where it should resolve its host name, Toe I p address. So let's look at our length machine and then we will find out how how to read these files. It's clear the screen. Okay, the first file that we're gonna look at its etc. And a switch. So just do cat on etc. And a switch dot com file. You will see it starting with host Let's let's Doom or on it instead of just Cat. So this hills to read the file page by page. Okay, so all these stuff, anything that starts with pound, it means it's just comment anything that you want to have it in effect, just remove the comment. So let's go through it. Let's go to the point where we don't see the comment. So here it's starting from this page on it is a password file. So the first thing is telling you that look for the pastor part and the files don't go anywhere. There's no active directory, there's no other. And I asked Service That's running that's going to give you the pastors or look for at sea passwords. Shadow is also etc. Shadow. That's local group is also at si group, and when you come down to hose to right here, it's gonna tell you the the host information off your system is located in the files, and that is at sea host. And then it's going to say if you can't find it, then go to DNS. The N S is an other service that is installed on Lenox Machine, or it could be installed, and Windows machine will cover that later on. But for now, this is the N S. Which file looks like. And if you want your horse to be resolved, DNS, first you search Deanna's here to here, and file comes the second. So this is the in a switch file. You're gonna be seeing this configuration of this file many times while you're doing system administration. Next one we're gonna look at is at Sea Host SC Host file is where you define your system I p address and system host name. So if my system I p address is if config it's one I to 1 61 about 14 I could go into that at sea file becoming Route B. I the file and I could go at the bottom and I could put one I to 1 $68.1 dollar 14 and the host name off. My machine is, um, gone to me. Save it and they my first Linux os. So let's do it again. My it doesn't matter. Upper case. Lower cape. My first Lennox Lewis. My first Lennox Always. So now if you paying my first Lennox os, it's gonna paying your I p address you see right here the one that you specified in the etc file. So that's what at sea file does. It's a small a very tiny version of Deanna's that's sitting in your machine. The next one we have at sea sis Config a network file this file Sorry, this its network. I believe you know I'm right. So this is the file where you specify your horse name as well. Right now it's empty because we have hard coded the host name. But if you want to change it, you could modify it here, and certain other parameters can be set to. Of course, you are more than welcome to look it up more on the network file. The next file that we're gonna be covering is actually the file. That's where you specify your I p address on all the network all the sudden it mask and gateway. And when you are in the directory at sea says config, network scripts I want you to do ls minus. Lt are. And the last file you're going to see is I f g e and E and P zero s three. And what ISS this the last one. It's actually your interface. If you go if confected and you will see right here. This is the name off your interface. So remember every time all those interfaces files all this started. I if csg dash in the interface name So when you ve I that file here you will see the boot Proto is defined as the CPU could change that at hair ecstatic. And then you could define the I P. Address. You got to find some that mask eight way. And this way your I p address becomes prominent in your machine does not change. So these are a few few of the files that I really want. You understand and memorize it because if you are going to go into Lennox Jobs and you're gonna be applying for it often times you're gonna get questions on these where these files are, what the files do, where the located and so on. So let's exit out of this file. The last fall I have is at sea resolved Outcome at sea result dark off. Specifies your DNS server. Deanna server is again once again, it actually resolved host name to I P i p to host name and host name to host name. So if you define it here every time you go to www dot google dot com and hit Enter, it knows Google is I have to go into this is my way. I have to go to my gateway, which is right now acting as a DNS server. I'm gonna go to my Deanna seven ask where is Google and how to translate Google to I p edit and has translated. And this is the I. P address of Google. Let's go back to our lesson. The next one we have the network commands the network commands. We have learned Ping already. If you wanted to paying a server, let's say paying www dot hotmail dot com. That's a server outside that command that you will run is pink. If config tells you what your interfaces are in the system we have right now, three interface is the local one does not count as interface and the other one you could ignore the only one that I have is just one admits this is right there is telling me my i p is configured this. Then you have If up if down. If you want to bring down this interface, If you don't want a network, you could type it up. Sorry if down. Or if you want to bring you back up your type if then the next one we have net stat. And that's that. You go around with different options. I run is usually R and B. This one tells you your gateway how your traffic is flowing from which interfaces is falling from and the last one we're gonna cover is TCP dump TCP dump. It actually traces every single transactions that leaving your machine and coming into your machine to the command to run is simply TCP dump. You have to specify I with interface which interface you are sniffing. It's basically a sniffing tool and then you run it and you'll see every listening coming in , coming, going out. It's actually listed here. So that's how you actually run this TCB command. That's how you run all these commands and please memorize it. Please run a man command on each and every one of them and familiarize yourself how these network commands and files work 39. System Updates and Repos: system updates and repose. Repost stands for repositories. This is a very important lesson for installing new packages to your systems, So there are two major commands that are used in system updates and repose. Installation is the 1st 1 is young junk. A man is mostly used in santo s or IT and red hat environment, whereas act get is another similar commander is used in other limits distribution servers. Jum Command installs a package from the repositories that are defined in your Lennox system . Those repositories of those configuration files has the Ural Link for repositories. So when you run Jum, it's telling the system. Go online with this your URL and get the package that I'm asking you to install. So, in other words, Jum does need and Internet access to go online and install a package to your system, then the next command we have is our PM. RPM stands for Red Hat package manager. Now our PM off course was first developed by red hot, and it's still in used by red hat. But nowadays, many other linens distributions have carried over the same command rpm That never changed. Now what's the purpose of RPM before I tell you about our PM, let me tell you a difference between our PM and yum. This will be much easier for you to understand what rpm is. Our PM is used when you already have a package downloaded in your system. And then you could install it locally by running the command R p M. Now where, As young Young does all the things for you and downloads the package, it installs the package as well. So our PM is mostly used in environment where they don't have Internet access. So let's get into our legs when she knelt to try out both of these commands. Okay, I'm logged into my Linux machine as Root bitch directory. I'm in. I'm in root directory and there are different commands. And, of course, what is my host name? My host name is my firstly next machine Alexe us. Of course. Now we know we're not in the wrong system. When you're installing packages, please also make sure run a host name so you don't install packages toe a wrong system. Okay, so now the next kept The first command of you will learn is John. If I wanted to install a package. Let's say NTP, all I have to do is type young NTP so young, installed and tp it will go outside to the mirrors or wherever the u. R L has been specified and it will look for our anti package. Now, before it goes outside, it looks for within itself within it since its own system and see whether the NTV pet package has been installed already or not. In this case, I try to insult NTP package. And what happened? It's his NTP package has already been installed with the latest version. So nothing to do. Okay, Perfect. So I don't have to install it. I don't have to update it. Now. What about if I wanted to install um, Apache and a podgy package? Name is http. It will do a gain the same thing. And if I have the system, if I have the package install, it will give me the same message that it gave me before. Um, this is no package. HDP available, I believe. Is http d Okay. Yes. Same message issued a P D sent to us already installed, and with the latest version. Okay, so now, before we go headed and try 1/3 package to install. I wanted to check if that package has already been installed in my system or not. And to check that I have to run the command r p m minus, which is an option queue for Curie. Query all the package that I haven't told my system with minus eight with a option you can enter. It went into my list of packages that installed it is giving me every single packages. Of course, there. So many of them. What if I wanted to know how Maney package have installed? I will do simply wc minus fell. This will get me the total number packages that installed. Of course, WC Minds help in this case is not actually counting the packages it actually count counting the lines, the output off RP minus Qiwei just telling me there are 313 150 packages installed Now I want to see I want to install a package for DNS now, before and salt packet for Deanna's. I wanted to check if that package is installed so I'll do RP minus. Kiwane grew up and the package that needs to install Association associated with DNS. It's called Bind All Do our PM minus queuing and grow for bind only, and you will see here it has buying libraries key binds buying libraries by lot, license RBC buying and buying utilities. So there is no package with just bind, so it means I don't have DNS installed. So what I will do is I will install by running the command yum install find when I hit Enter. Now it's doing the same thing. It's going outside on the Internet, to all the repositories that are defined in my configuration files, and it's coming back with the package saying, Hey, I found this package called Bine and its architectural version that I find which matches to your system a 64 bit. The version that you will be installing off mine is this repositories are is updates repository, and the size is one point eight megabytes. The transaction summaries right here installed one package. Total download size is going to be 1.8 meg, so I'll go ahead and it will say, Is it okay? I'll say yes. Go ahead and install the package. And if you see the progress depending on the speed off your computer how fast it is connected to the Internet. Um, that's what matters in doing the download and install. So right now, if you see that the JUM is doing two things for us one, it's downloading the pack. Once it's completed. Downloading, then right here it's installing the package. It's installed once it's installed, it verified it. And it has confirmed that I it has installed a package. Now, how do I verify again manually, by running the command R p him minus kiwi, Great or bind. Okay. And now this time you will see um, right here. Yes, the 3rd 4th line. This one is just simply bind without any Libs license or any other extra packages that needed for bind. So jump also installs any dependencies. Meaning if there is any other packages that is required with this package, it does it for for self. Where's our PM? If you have one rpm package you when you run the command, it will tell you Hey, I don't have that dependency. So you have to install that package as well. So, to against you go back to our RPM Command to install a package you have to use the command R p m minus. I ate three. Or you could change that to HIV V i h whichever the way you want space the location off your rpm. So if you have downloaded your rpm and let's attempt, then you will specify slash temp slash package Whatever the name off packages and usually the package ends but dot R p m. Then when you run this command, it will install that package for you. Now you could also do R p m minus e to remove a package. So let's say if I wanted to remove this package, find the one we just installed. So I will have to type here now find our package is not so sorry. I did some kind of mistake so hard. P minus. See? Let me see. Fucker. Copy and paste should be able to do that. Yes. Copy on. Paste it. It's gone now. Can I verify it? RP minus Qiwei. Great for bind. Okay, You see, it's not there. So what do we do now? For one, it wasn't solid back. Have a luge young installed by click. Yes, to install it. Yes, it is downloading again. Same process, and it's downloading now. You're probably thinking, K. Didn't it download when we when we did the same command before? Yes, it did download. But jump is very smart. Tool. What it does, it downloads. It installs, it verifies, and it also cleans up your download. So they so your space. The space is used more efficiently, so it doesn't keep the old downloads on your system. Okay, so now the download is completed. Let's check again. If he had the package. Yes, we do have the package. And package is right here. The 1st 1 Now we use the R P. M minus E command to remove that package. And we could also do junk remove mind, and it will do the same thing as if I would do R p m minus e. It says remove one package. Yes. Go ahead and move it. They go. So it's gone. So anyway, guys off, I hope you know now that how rpm and young command works, you will be working a lot with this. These two commands, if you gonna be in system administration capacity