Perfect 3 Days Linux Course | Imran Afzal | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
63 Lessons (6h 57m)
    • 1. Promo video

      1:11
    • 2. Syllabus Overview

      4:26
    • 3. Welcome

      0:19
    • 4. Day1

      0:21
    • 5. What is Linux

      2:56
    • 6. Unix vs

      3:05
    • 7. What is VirtualBox

      1:52
    • 8. Download and Install VirtualBox

      3:32
    • 9. Creating First Virtual Machine

      5:20
    • 10. Linux Distribution

      2:29
    • 11. Different Ways to Install OS

      3:02
    • 12. Linux CentOS Installation

      21:51
    • 13. Message for Redhat Installation

      0:45
    • 14. Redhat Linux Install

      7:58
    • 15. Download and Install Putty

      2:32
    • 16. Connect Linux via Putty

      5:03
    • 17. Changing password

      4:36
    • 18. Introduction to File System

      5:14
    • 19. FileSystem Description

      2:29
    • 20. FileSystem Navigation Commands

      9:58
    • 21. Filesystem Paths

      5:03
    • 22. Directory listing overview

      3:11
    • 23. Creating Files and Directories

      8:47
    • 24. Finding files and directories

      7:00
    • 25. Wildcards

      10:01
    • 26. Day2

      0:13
    • 27. Pipe

      5:09
    • 28. Files and Directory Permissions

      12:57
    • 29. File Ownership Commands

      11:35
    • 30. Help Commands

      5:02
    • 31. Adding Text to Files

      12:31
    • 32. File Maintenace Commands

      11:44
    • 33. File Display Commands

      8:16
    • 34. Filter Text Processor Commands

      13:17
    • 35. Compare Files

      4:22
    • 36. Compress and uncompress

      9:42
    • 37. Vi Editor

      14:32
    • 38. User Account Management

      15:01
    • 39. Switch Users and Sudo

      8:40
    • 40. Monitor Users

      7:07
    • 41. System Utility Commands

      8:45
    • 42. Day3

      0:30
    • 43. Processes and Jobs

      19:38
    • 44. System Monitoring Commands

      9:09
    • 45. System Maintenance Commands

      5:02
    • 46. Changing hostname

      5:44
    • 47. Finding System Information

      4:39
    • 48. Terminal Ctrl Keys

      3:45
    • 49. What is Kernel

      2:25
    • 50. What is Shell

      3:07
    • 51. Shell Scripting

      3:18
    • 52. Basic Shell Scripts

      12:41
    • 53. Aliases

      9:39
    • 54. Shell Scripting

      3:18
    • 55. Enabling Internet in Linux VM

      3:00
    • 56. Network Files and Commands

      9:25
    • 57. NIC Information

      7:06
    • 58. System Updates and Repos

      12:10
    • 59. System Upgrade and Patch Management

      8:40
    • 60. System Run Levels

      4:51
    • 61. File Transfer

      10:25
    • 62. Message of the Day

      3:10
    • 63. Disk Partition Commands

      3:07

About This Class

In 3 days you will be able to perform Linux installation, configuration, administration, scripting and much more...

This course is designed for those students who do not have enough time to learn Linux.  They want to be able to do Linux installation and manage the Linux server by running commands in 3 days.  Spend a few hours with me everyday for the next 3 days and I will make sure you will learn the following:

Day 1 – Installation, Configuration, File System and Basic Commands

  • Understanding of Linux?
  • What is Oracle Virtual Box?
  • Downloading and Installing Oracle Virtual Box
  • Creating virtual machine
  • Linux Distributions
  • Downloading and Installing Linux (CentOS)
  • 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 system paths
  • Finding Files and Directories (find, locate)
  • Wildcard (*, $, ^)
  • Quiz and Handouts

 

Day 2 – Linux System Administration

  • File Permissions (chmod)
  • File Ownership (chown, chgrp)
  • Getting Help (man, whatis etc.)
  • Adding text to file
  • Pipes ( | )
  • File Maintenance Commands
  • File Display Commands
  • Filters / Text Processing Commands (cut, sort, grep, awk, uniq, wc)
  • Compare Files (diff, cmp)
  • Compress and un-compress files/directories (tar, gzip, gunzip)
  • Linux File Editors (vi text editor)
  • User account management (useradd, groupadd, usermod, userdel, groupdel)
  • Switch users and Sudo access
  • Monitor users (who, id, last)
  • System utility commands (date, uptime, hostname, which, cal, bc etc.)
  • Quiz and Handouts

 

Day 3 – Advance Linux System Administration

  • Processes and schedules (systemctl, ps, top, kill, crontab and at)
  • System Monitoring Commands (top, df, dmesg, iostat 1, netstat, free etc.)
  • OS Maintenance Commands (shutdown, reboot, halt, init etc.)
  • Changing System Hostname (hostnamectl)
  • Finding System Information (uname, cat /etc/redhat-release, cat /etc/*rel*, dmidecode)
  • Terminal control keys
  • Linux Kernel
  • What is Shell?
  • Shell scripting
  • Basic Shell scripts
  • Aliases
  • Command history
  • Enabling Internet in Linux VM
  • Network Files and Commands (ping, ifconfig, netstat, tcpdump, networking config files)
  • Network Interface (ethtool)
  • System Updates and Repositories (rpm and yum)
  • System Upgrade and Path Management
  • System Run Levels
  • File transfer (ftp, scp, rsync etc.)
  • Message of the Day
  • Disk Partition (df, fdisk, etc.)
  • Quiz and Handouts

Transcripts

1. Promo video: Hi and welcome to my course. Perfect. Three days, Lennox. Course I know exactly why you are here. You're busy in your life and hardly have enough time to learn something new. And now you have stumble upon my course and thinking, Is it really possible to learn Lennox in three days? Well, the answer is yes. Just give me a couple of hours every day for three days, and I will teach you exactly what you're looking for. My name is Imron, Absolute, and I've been working in I t. For over a decade and 1/2 I have worked in New York City for financial firms, fashion industries and tech media industries. I have completed my M B A from N. Y T and my B B A in computer information systems for brew college. Both of them are in New York City. At the end of this course, you will be able to run many letters, commands and perform letting system administration tasks. So what you waiting for? Let's go ahead and click on enroll 2. Syllabus Overview: Now let's go over our training syllabus and see what exactly are we going to cover in these three days? The first day is going to cover the installation configuration file to something basic commands, so we will start off. It's a little bit off understanding what Lennox is. If you really know what the nexus just kept through it, then we will install worship box in our environment and the reason we need to install worship box because we have to set up a lab once the warship boxes install. Then we will installed Lennox, which is sent OS operating system on a washing machine that will connect our party. We don't with the party. We connect to a Lennix machine, threw a party and then continued on Lenox Day one. We will learn how to change password, start the introduction of file system, the file system structure. Bosses of navigation commands, which are the three most basic command of all system navigation, will cover the directory listing overview, which means that every time you run ls command and your Lennox, you will get different feels and it'll cover each real one at a time. Creating falls in directories What are those different commands? The file system pats. There are different type of past absolute path, right to pet finding files and directories, the wild cards. And, of course, every day we will have a few quizzes, the whole work for you to do and a few handouts for you to read. They, too, will do the Lennox System administration. This is what most of the administrators engineers in Lenox capacity follow every day. And here we will start with the file system permissions. Some of the commands are changed. Mod changed. Ownership changed. Group Those know how to get help while we are and lyrics system How we could add Tex Toe a file without doing a V I editor. We'll learn how to combine commands through pipe Some of the file maintenance commands that are you really need to know every day. Commands like copy, removed, move and making directories. The display commands will display the contents of the fall and there many different commands that we will learn in that the filters and tax processing like cut sword grip on many of the commands comparing file, compressing un compressing. We'll continue our day to with Lennox file editor bit. We will learn how added a file using the I. Then we'll have learned how to manage user accounts by creating yours accounts, creating groups and removing and managing them. Switching users, monitoring users, talking to users and some systems utility commands that will help you find out some of the information while you locked in. They three will get into it fast. Lyrics System Administration. Now this includes a process and scheduling Cron tabs and running system processing. Once you run them, how do we monitor them? How do you mind to those commands how we monitor the process? Is there so many different commands? Able color maintenance command changing host name, file system information, Terminal control keys. Colonel will talk about what is a shell. We learn basic stuff about show scripting, and I added one bonus if then shell script. If you want to get into some advanced level shell scripting, then continued on, the three will learn Alia's. Some history Command will enable Internet on our lyrics machines so we could access the network files and commands. So then we have no interface is how do we check the network interface. Its status and its configuration. How do we update our system and difference between updating upgrades, The system run levels, how to transfer file from one system to another message of the day and disposition at the end? Always every day we will have home quizzes, homework and handouts. Please don't be scared that there are so many things you'll you'll have to cover. But I'm telling you, if you are dedicated enough and spend a few hours every day, you will cover it with me and you will be able to perform many, many different tasks and Lennox. 3. Welcome: welcome. And thanks for enrolling in my course perfect three days length course. At the end of this course, you will be able to perform lyrics, installation, configuration and perform. Many system administration task were running useful commands, so let's get started. 4. Day1: Welcome to Day One. Today we will learn the installation off Lennox and its configuration. We will also cover the file system. What are the different type of file systems? Are there what exactly? A file system is also followed by some Lennox basic commands. 5. What is Linux: What is Lennox? Of course, you should know that because you have picked this course and you have decided that you want to learn Lennox. And the basic question is, of course, what is Lennox that? What is that you want? You are learning the basics and simple definition off Lennox is that it's an operating system just like any other operating system. For example, Microsoft has Windows you. When you turn on your PC, you will see the first thing you'll see is you welcome screen off Windows status. An actual operating system. You have Solaris and has UNIX running on it. And that's how other many other Obering system out there, said Lennox is just like that, which manages your computer hardware. And you have a computer, which is a piece off device. It's a computer PC or it's a server. It's a dumb terminal. Until you install some kind of operating system. You pop out the tray, you insert the CD in or DVD in, which has your operating system software. You go through the installation process. You ask a few questions, such as host name, never configuration. Some petition, some ah repository information. What are the packages that you want install. You go through all that questions and you answer them. And at the end, off the installation, you will have a welcome screen screen telling you that you're offering system has been successfully installed. Once it is installed, you reboot your computer, it comes back online, and then you could attach your other peripheral devices, such as keyboard mouse. And once you have that attach, you could actually work with the operating system to write your letters, send some commands, get on the Internet, and then once you have that, you can send that to your operating system. If you writing a letter and you want to print it, then your operating system can talk to other peripheral devices such as printer, and it will send out your document. Now this is all what operating system is doing it. Also share your documents or your resource if you want to to other computers on the network , anything that is out on the Internet. If you want to send out to the Internet, that's how it works on. Of course, pleased to remember Lennox is primarily is an open source. What it means is that it's sources code that it's it's written and it's it's open. People could view it and they could change it. It does not apply to the clinics offering system such as Red Hat, which are actually enterprise level operating systems. 6. Unix vs: Let's look at Gen X versus Linux. Cincy. What are the differences? But before we get into finding the differences will find out what UNIX is. UNIX was first developed for multi user and multi task purposes in mid 19 seventies in Bell Labs by A, T and T, G E and Massachusetts Institute of Technology. There was an operating system but was not allowing for multi users or multitasking. So that was one of the purpose for creating that then born lyrics in 1991. But a French student named Lynn Extra Walls Lennox is mostly free, and linen is open source. So what Lennox free means is you could install the Linux operating system in any off your computer hardware. There are a few lyrics distributions that are not free, like red Hat, where you would have to pay for support. A subscription. And the open source means that Lennox code that was DR from UNIX is actually open to the public to the community so they could go and and make changes to that code and make the operating system the way they wanted toe work in their own weight. UNIX is mostly used by Sun and the operating system is called Solaris. By the way, Son is now bought out by Oracle and also other operating systems that are UNIX is used as HP UX by HP Ai accent. Some other distributions off UNIX Lennox is used mostly by developer communities or companies like Red Hat sent OS Debian Fedora Soucy Bun, too. And they're so many of them. Even if you go out and search for Lennox distributions, you will find so many of them. UNIX is comparatively support. Very fewer file system. Now what is a file system? That is something that we will cover later. But there are fewer follows system that supported by UNIX operating system and a lot more file system that are supported and clinics flavors. Lennox can be installed on a variety off computer hardware ranging from mobile phones, tablet video games, consoles to mainframe and supercomputers is just like you cannot install Mac operating system on the Dell machine. You have to install Mac operating systems on a Mac hardware. Just like that, UNIX is Onley installed on certain hardware were as Lennox, you could install pretty much on every hardware that is out there running am Dio Intel processor. So these are the few basics about UNIX and Lennox, and I hope you will find more information if you're curious about it online. 7. 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. 8. Download and Install VirtualBox: 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. 9. 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. 10. 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 11. Different Ways to Install OS: What are the different ways to install an operating system? Ah, well, there are many different ways, but the most common ways I'm gonna cover there are three most common ways, and the 1st 1 is through the CD or DVD. Now you have a CD or DVD, often operating system, whether it's Lennox Windows, our Mac, um, the insulation procedure often are starting. Opening system is the same, but the 1st 1 is you popped the tray out off your computer, but it's a server or laptop or workstation. You pop the CD drum, drive out, insert a CD in and then boot from CD. Now this is the most common way, and once the CD is installed inserted, the insulation program begins. The second way is through the ice or image you install, and are you actually download the image from the window rep side. Let's say if you're installing right hat Santo s windows, you go to redhead website or you go to Microsoft upside. You don't know the icer image. You attach that Eissa image to the worship disk off your computer. Now, how do you access the virtual disk? Every computer, um, has a consul axis, for example, Dell has Ah, I drag. HP has ill Oh, and so on. So there are many different manufacturer have their different way of accessing their council. Once you access the consul, you could attach this ISA image as a virtual disk and start the installation in our lesson . This is what we will be following. The third method is the network boot. This is also common in bigger organization where there are building hundreds off computers , installing offering systems 100 of them a day. That's when you need ah never boot. Basically, you, ah, tell you computer to go to a Pacific I p and a Pacific folder that is being shared by, uh, a shared server that could be either NFS server or samba server. That attach is that file your given i P address, and then you do the network boot. So these are the three common ways to do the operating system installation. And again, for our lesson, we will be covering the 2nd 1 which is the I S o download. We have already downloaded it and we will attach that I soto our Work chul environment and do the installation 12. Linux CentOS Installation: Santos insulation or Lennox insulation. Now this is the fun part. Yes, that's where we are. We going to get our hands dirty. We're going to do the installation off the Lennox that real work. The first thing that we have to do is go to our browser, and if you don't know the exact link, you could just go to www dot google dot com. You guys know that, and just type that sent OS download First Link, which say's download sent. I was click on it. On this page, you will have three different options. By the way, if you are going straight to the download page, which is right here, sent us up for Slash download, which I had it already open on this tab. But anywhere since we already on this page, um, we have three different options. First option is DVD. I so image. Now this is the one that we will be clicking on and downloading image. The 2nd 1 is everything as though this image is about twice the size off the DVD I so image it has many different optional packages that are that might be needed for development purposes that might be needed for other servers that required certain libraries. And many of the stuff. 3rd 1 we have is minimum isil. This one probably does not have the gooey on other required tools that we need for this for this training. So we'll skip that too. So we'll pick the 1st 1 Once you click on it, you will get the complete list of all the DVDs links that you have all the ice. So images, links. I don't remember. The latest version off Santo s seven on the update is force of $7 for is the latest version off center West Lenox offering system. It's the same version for red hat again. The only difference is red hat. You get the support, you get the patches and updates, whereas in Santo s, you do not get all those updates and support M plus cento us his freaks. So we'll click the first link and it will ask you to save the file. Now, in your case, it might ask you to where to save it. So you pick the older where you want to say now I have already a download process going on . So if you click on this little, um, icon here, Um, depending on your browser, this is Firefox that I'm running. You click on it and you'll see right here. I have the scent os seven, x 86 64 DVD. I saw image that is already being downloaded. Um, it will take one hour, 56 minutes from from this time on. Um, and of course, I will stop the recording here because I will wait for the download to finish. Okay, finally, we have the scent os Lennox. I also image has been installed and has been downloaded, actually, and I have downloaded it. And on my desktop, this is the full name off the ISO image. You could also check if there has completely downloaded by clicking for right clicking and going to properties. And you will see the size of the ISA image is 4.2 gigabyte, which seems about right. So now we will have to Attash that s o image to our work jewel machine that we created. So let's start up. The oracle were show Virtual Box and Harry, have this fortune machine ever created. I'm gonna click on start. No. Once we click on start, it should bring up Ah, window for that for that virtual machine, and it will ask us to pick your operating system miso image. So if it is the host E Drive, which means you probably have inserted your CD or DVD a za hard copy and you have inserted to the D drive off your laptop, then you will pick that. But since we have the eyes so image, we'll click on this little folder here to specify the location off our eyes, an image file and, of course, our guru death stop. That's where I have it saved and you will see here. Say, sent OS seven. This is the Is in Mississippi, have downloaded will select that and click on open once it click on open click on Start and very good. This is the first page you will see either it's red hat, Linux or Santo s links of any type of Lennox distribution. You should see this install first page. It will tell you that it will start installation automatically in you number of second that you see at the bottom you could click you could hit enter to start the installation. Um, I just clicked inside the window. This warship box came up which tells you that you have clicked the mouse inside the washing machine to capture and you could just capture and then hit. Enter. You could close down this message. Annoying message that comes up from the top. Okay, this is showing that it is loading the eyes. So image to the washing machine. Here. You will see this, um, message. This is press escape. Toe aboard. Check. Now, if you have a CD, sometimes what happened with the CD is you do get scratches in the seedy and sometimes it effects your installation. That's why does the check. But now, since we're doing through the ice and image, it's not possible to have any kind of scratches. Of course. So what we'll do here is we will. It escaped to skip that check. The installer that installs are the installed visit that installed the Lennox Santo s. That installer is called Anaconda, so it's starting that Stoller right now. Okay, so now we have a welcome screen here. Um, so basically, we have to go through this visit one by one. So this welcome screen tells you to pick the language depending on your language. Prior your preference. Um, I'm gonna pick the English with the United States. Come down There is a scroll bar on the right hand side, and then you click on Continue. Um, the first option that you have is dating time, which has already selected for you America's New York Time zone. If you are in a different time zone, please select that time zone according to your country or city. Then the keyboard. They should come up with default keyboard. Since we selected English come up with English keyboard, then we have the software installation source. So give it a few minutes until we get that dependencies resolve. It says checking software dependency. Please note that there will be a delay in during the installation, and I vill fast forward it. So this is where you don't lose any time. So there you go. So I came up, came up with installation source in solution Source is the local media victories are Santo s software selection. This is what you have to pick that was gonna tell you? Well, kind off packages that you wanted to install, Remember? Let's say if you have a Windows machine, right? And in vending machine, there are sometimes that pre installed packages come and there are Sometimes you have to install it afterwards, For example, that say, if you want to install Microsoft office, you have been sold later on. Does not come with it just like that. Just, uh, I saw image allows us to have the list of all the packages. If you want to download Sal's will go where One by one we'll leave. The minimum installed has is infrastructure server. If this is a server, that's gonna be doing like a bigger work like DNS name server are file server. This is what it's gonna be working on. The infrastructure server tells you, if you want, install the DNS over on it. If you're gonna run any kind of extra email server, any FTP server, anything. So we will pick a couple of them like Deanna Silver because we want to cover a little bit about the N s and are training Well, pick the FTP server. So then we go to basic Web server. We don't need to install any kind off, uh, Web server tools server with gooey. Uh, this is where if you want to get a gooey with the server, you could pick the K T E, which is, which is also a type of gooey. Then we have genome Desktop will pick the gene of applications. There are some application that you was used like a calculator on the type of applications that come with the operating systems of you. Picked that one Internet application you don't need email, chat and video confidence offer. So these are all the different things that you could download. So we'll leave that as this up to here is a basic one. We'll go back up and click on Done. That's now, if you see the installation source is checking again, going back to our software media and checking whatever that we have selected. Whether this source has those packages, so give it a few minutes. Once is done checking the software dependencies, then we'll go to the next step, which is the installation destination and other network a horse name. Okay, so once all the software selection is completed and source installation source has been verified that it has all those packages that we have selected, then the next step is to move to the installation destination the installation desolate destination allows us to install are offering system with different partitions. What different partition means. Think off has Windows. When you have sometimes Windows, you have see Dr Deidre or E Drive there many different drives in Windows that you could create just like that. A simple disk in this case, 10 gig. We could partition that disk into different drives. And once the petition that disk into different drive, we could actually have a simple small partition toe everyone for this course, and for this training, we will leave as automatically configure partitioning, and we will not configure it ourself. So we'll just click on that disk. We'll select that which is already selected and click undone. Then the next option we have is K dump. Okay, dump is enabled. What is a Caden K dump is when Lennox has this programmed Iran's inside of its called Colonel. When Colonel crashes, it creates a dump, which has a log. Father's tells you what happened to it, so that's what it's enabling it, meaning when something was wrong. It will spit out a lock file that would tell you what happened to your operations. Next step we have is a network and hosting. When you select on that one, I want you to come down to make this bigger. And here I have selected my first Lennox. William, you could change this name as well. Remember, this host name is not the same name as recreated for our virtual box. Virtual box, which is a virtual machine, is different. Working machine name, then the host name off this machine. So for this will create my first Lennox os. Sorry. First Lennox, then you can click on apply, then most likely you're gonna have This has turned off. So all I want you to do this is where you actually define your network. So I want you to do is click on once you click on, then it's gonna try to connect and get you an I p address, subject mask and Gabe with. If you are working in a corporate and wire men than most of the time, you will have a static I p, which is a dedicated I p a gateway and net must never mask, which is given to you guys by the networking team. You could take the information, and then you could configure the network interface. Right Here you go click on Configure Blue and here you'll see it has Ethernet. Leave that people's and go toe I PV for setting and you'll see here. Automatic D A c p D. A. C p is basically, if an I p assigned whenever computer boots up, whichever the I P is available if you want it too hard. Code an I p address. So every time your computer boots up and I p does not changes, then you drop down and click on Mandel. Then click on add and put an address in that mass and gateway here and then click on apply . But since we are going with, DCP will pick that and apply. So for this one for this in this case, we'll just cancel it and click on Don't security policy. You don't have to select any security policy. So now if you notice we have picked the localization setting, you have picked a software setting and we have picked, System said. Once that is completed, come down and click on begin installation. Now, as it's doing its installation, you see at the bottom it says, creating disc label, and it will go through all the installation. While it's doing that at the top, it's giving you user setting. Sir. Route is like administrator, a primary user off your computer, which is a very powerful account. You have to set the password for your group right here, so click on this option and pick a password. It is highly recommended that you pick a strong password so it cannot be gift and then click on Done. Once that is done, the next thing is used creation. I would highly recommend you guys create a user, a first time user for your own self. Let's click on Create User full name. I'll put my name and see it automatically picked a user name for me, which is my first name. Initial on my last name. Make this user administrator. If you want to make yourself as the super user, you can by clicking Here requires a password to use account, and you can pick a password and then once done, if you notice does use, a setting is completed. Root passwords been picked. User account has been created. Now it's going through the package installation process. Now it could take anywhere from 10 to 30 minutes, depending on the packages to software that depict during our software installation options . So I'm gonna leave that as it's running, and I will fast forward that during the video capture. So this way you would know exactly what are the packages that being installed and when it's completed. - Okay , the installation is completed, and now it's performing post insulation set up task some off the settings that we completed , which is like a root passes set up account creation. That's where it's going through right now. Okay, So sent OS is now successfully installed and ready for you to use. Go ahead and reboot to start using it. So simply follow the prompts and click on reboot. Look at the center s clinic. Seven is offering. System is starting right now. - So this is the license information. You have to accept that that's gonna be an initial set up, and then you click on finish configuration. Okay, so it's gonna come up with the log in page. You could log in with your user name, or you could just do not listed and log in as root. So we're gonna log in with our user, provide the password. Okay, so we are at this point where we have completed the Linux OS installation. So of course I will say, if you will have done this. And you at this point. Congratulations, everybody. You have done an amazing job. And this is your first Linux OS installation. You should pat yourself in the back. Yea. 13. Message for Redhat Installation: once again Congratulations, everyone for completing the Scent os installation In our next lesson. I am including Red Hat Linux installation. And remember, this installation is completely optional. The reason it is part off my training. So you will have the experience off installing red hat as well as cento us. All my lessons followed by this insulation are gonna be on Santo west that we installed in the previous lesson. But again, I want you. I encourage you to go through this. Red had installation as well. 14. Redhat Linux Install: just to let you know Lennox installation is exactly the same as center was. The first thing we'll do is we'll go to our Google friend Emel type red hat. Lennox, download. Once we go there, Um, it's gonna take me to, um a few links and I want you to go to right here. It says right had enterprise links download. And it's his developers Red hat. And you come in here. Um, you click on download. It says, download this product. You must have an account and accept the terms and condition off. Red hat. It's a download. Once you click on the download, it will ask you to his user name and password over email and password. If you do not have a using and password, I will hide recommend you to create a new one. I already have it. I logged in and I have already downloaded the red hat. I also image and it is downloaded here. I did that to save some time. So now since we have there, let's go to our Oracle worship machine. Sorry. Or commercial box Reality have one running which is running cento us. We're gonna create a new one, and we're gonna name it Red Hat. Liam, it automatically pick up Lennox type version already 64 bit. Next we leave everything default. Everything. Default. Next. Next, leave the A gig decides default. Create once it's created, it created a shell. You're going to start it by clicking. Start. Okay. Once the windows comes up, it's gonna ask you where your s O file is located. We're gonna click this little folder to pick on the location. If I measure its on our desktop, remember, your mouse is gonna be captured inside. If you want to release your mouth, you could just hit the control key on your right hand side of your keyboard. Not on the left hand side. Just click on this message. Pick the 1st 1 Install Red Hellenic 7.4. We are in the insulation visit. If you see it looks exactly like Santo West. The only difference is it has this red had logo on the left hand side, whereas Santos would have a center s local. So it's exactly looks like as Cento us will go down with picker language which is English and the United States continue the first option that we have to set as the date and time, which is already by default, set for me, which is America. New York. That's where I am the keyboard. Selected English US if you want change to a different language if you want British, English or European are Australian English. You could pick that language support automatically selected for me by default installation sources. Local media, which is I saw images that depict software install. This is the minimum that we're keeping by default. You don't want to install any gooey or any additional packages. We will keep insulation very simple. And then the installation destination. How we want to protection our system will just leave it default automatically configure petition that this sizes eight gig It is already selected and just click done once that it selected next options Kate Dumb is enable leave a default network and host name. Well, come down to the option. It was called down. Where has the host name host named this one of the important things that you need to pick. Well, pick Lennox Red hat $2.18 isn't my host name. You could pick any host name that you want click apply. Once you apply, you'll see here right here, says current host. Name is said to what I wanted to be to be set. You go back up on the right hand side. There is a network configuration. You could turn it on if you know the I P address or if you want to have a DCP assigned, just turn it on. It will pick it up and then you click next for this lesson, we will leave it off and just go on with the installation. Please do remember, you would have to click control key on your right hand side of the keyboard to get out off your window and squall down. And now you want to click begin installations, click inside again in the window and could begin installation wants him on the second screen. We'll select the root password. The root password is weak, I know, but we're just picking it because since it's a training environment, V, if you are in production or corporate, Marmon of strongly recommend you to pick a stronger password. We'll create a user as test set a password again. It is a weak password, but that's fine you would have to hit done twice, so it creates the user account for you. Now, if you notice has 329 packages that he needs to install right now, it's at 58. It will take anywhere from 5 to 10 minutes. So I'll just fast forward skip some of the past on. Go to the page where it will tell me the insulation is completed. Okay. All the packages insulation has been completed now is performing some post insulation set up in configuration. Installation has been completed. We'll come down and we'll click on reboot. Okay. The system has been rebooted. It came back. Now, if you notice there is no gooey, you simply get along and prompt with the host name in front off it. So you log in as root or test and you will have your route. Profit starts with pound or hash sign. So this is the Lennox installation for Red Hat. We did not pick the Gui insulation and 95 to 98% of the time in a corporate environment, you will not be allowed to install gooey 15. 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. 16. 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. 17. 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. 18. 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? 19. FileSystem Description: Now this is the time to look at the file system structure description. The 1st 1 has been Slash Been is the directory that has all the lyrics commands. So please remember that Slash been has the directory that has holding his commands. Slash food contains files that aren't used by offering system, but by its boot loader. Every time your computer boots the offering system looks into this directory. So look what files it needs to bring up the operating system, etc. Etc. Has all the configuration falls, additional programs and data files where you could change like if you are running NFS, you're running anti peace and male or you want to change your never configuration any type of configuration changes that you need to do you will go toe at sea and we gonna be working in our training a lot with this directory because we're gonna be changing the configuration file back and forth library, which is short for lip that has all the C programming library directories, which the root account that we have. That's his home directory. Espen. Has the system been Aries? Prock tells you. What are the different programs that are running temp has a temporary directories, and then you have slash home, um, and Windows as his comparison be, have user U S. E. R. In Lennox, we have home. And then the last one we have war. War is very important for you. And you probably gonna be long changing directory or going into this directory almost every day because this is where all the system logs are created. Every time you have an issue with the system, you're gonna go into this directory, you're gonna trace the logs, you're gonna check what the issue is, where the error are, where the problem is. So this directory issues for all the logging information. 20. 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. 21. Filesystem Paths: file system part pats. Here we will talk about how we could never get the file system through to the absolute path or relative path. So So, basically, there are two pats to navigate a file system. The 1st 1 is the absolute path, and the 2nd 1 is the role of the path. An absolute path always begins with slash. This indicates that the path starts at the root directory. An example often absolute path is if you are going to go into the Samba Directory, which is in War Log directory. It has two directories abo it so you could start with CD slash war slash log and slash Samba will take you directly to a samba folder. By the way, this is just a example that I picked up for to make you understand about the absolute path . Then we have the relative path which does not begin with slash. It identifies a location relative to your current position. An example of relative path is you see d into slash war. Once you are already in war, you could just do CD logs. Now you notice we're not using slash log because we are already in war directory and we could just simply go into CD log. And then from there we could see the into samba again. Here you are not using slash log or slash samba because they do not begin with slash, they are within the slash war directory. So let's look at the example. Okay, the first thing you have to do is become root user s you dash, you put in a password. Now, if you wanted to go directly to the samba folder, you could just go cd slash war slash log slash samba Where are you? You are in soir log samba If you notice if you go through the relative path, which means let's go to slash We are in root directory, slash directory and you want to go to the war directory. You could simply do war or you could also do war once you in this directory. And if you try to do at this point, if you try to do CD slash log, it's not gonna find it because what you're trying to tell the operating system that there is a log directory within the slash directory, which is not the case. So how are we going to get into the log is by simply CD log, and if you do PWD, you'll see you are in war log Now. If you want to go into one more directory, which is samba, what command would you run? CD slash samba or CD sama? Well, you will run CD samba and will take you to the samba directory. When you do P W. D, it would tell you you are in war slash log slash samba directory. So this is the main difference between the absolute path and the relative path. And the reason you use thes two different path is because if you already know the directory where you want to go in, you don't have to go into one directory than the 2nd 3rd off Ward. You could directly go into the path off the directory in our case, which is again war sash, log slash samba and there you are. And for example, if you want to go to another director, let's say we're going to CD at sea, says config and network scripts. You could just do that, and it will take you there. By the way, if you hit Tab, it will auto. Complete your directory. If it exists in there now you Which doctor you are in you and it ceases config. Network scripts. If you want to get out of from one directory, you do CD dot dot Where are you? You are in it ceases config. You want to go one step back, you do CD dot dot and you are in etc. If you want to go one more directory out, you do CD dot dot and you do. You are into slash directory again, the Root Directory, the main parent directory. So that's the That's what this lecture is about to tell you. Ah, the difference between the absolute path and relative path. 22. 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 23. 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. 24. Finding files and directories: finding files and direct trees. Often time system administrators are system engineers are traditions. Whoever the user off limits is they forget where files are located, just like in Windows. When you want to file, find a file, you're given a little search box and the top off the window and your type in the search and looks for its file. It takes a very long time, of course, and Windows. But Lennox. It's a lot faster and a lot easier. So there are two main commands that are used to find files and directories in your system and the reason you need to find it. If you remember, I gave you example off our closet, you go into our closet. You you want to find a shirt that you haven't been born for a long time, and you don't know where you have a which drawer of its shelf. You do need to have tools to look for those files and those tools in linen or find and locate. So we're gonna use those for commands in our lyrics environment and do some exercises and see how they work. So here we have our limits machine, and let's find out where you are. We are in our home directory and in our home directory. We have files, um, different files in different directories. I wanted to go into Seinfeld directory, and I want to see what's inside of it inside of it. There are different files called Creamer George Jerry Putty, Seinfeld characters, all those different parts. Now what if you are you go back one step and you are in home directory. And here you you thought that you created a file called Cramer in this home directory. But when you come in here, you don't see it. So you could either go into each directory one by one to a less command and find it, which is very cumbersome. You don't want to do it so you could find it by the command. Fine. The first. The syntax of the command is fine. And where do you want want to find it? You could give a relative path, which is dot which means in this current directory, start the search from this concurrent directory and this contradictory is home. I have self so fine dot Dash name space, double coat, Cramer, the coat clothes and you hit enter. It's gonna tell you that the Kramer file is inside off Seinfeld directory. And it's in their starting from this current directory. So this contract, he has Seinfeld dirty? Yes, of course. And now I know I created that Cramer file and signed folk. Okay, perfect. Locate. Command works the same way. So you are in your home directory and you want to locate Cramer. This is telling you exactly where that file is. Fine. Command is used sometimes to look for files in a very high rock way, where you have tons of different directory where locate is gonna find you in a short searches. So if you want to find where that's a are never file is where does located. So if you see fine slash because you want to find the network file from the root off the file system because you don't know where that file is Starting from which directory. So you always start with root space Dash name comma. If C f G dash and what is our interface? We don't know our interface a well, just control, See, And we'll do if config and aren't if S e and P s zero as three. So fine slash name. C f g. This is the name is a file name off our interface, which we will cover by the way later. And we want to find it now. We're getting all the permission denied. Whoa! OK, OK. Relax. Relax. Why are we getting permission denied? Why? Didn't find it? Mm. Okay, I know why. And I'm sure you guys know why too. Because you do not have permissions to go into certain directories. So why? Because you are I have cell and who have permission to go into different territories. Tell me route. Yes. Route has it. So you do s you Stroot to become root, put in a password. Now you run that command, find slash from the beginning. C f g, Dash, D and P. Um, I always forget that story. Okay, so fine slash name. And if c f g, Dash d and P's OS zero s three and now I'm gonna run it now, it's gonna go into every directory and look for it. The 1st 1 is just a run directory. It suppose this is just so for the process itself. So don't worry about it. You ignored 2nd 1 you'll see it, found it. It is telling me this file that you're looking for is in etc. Sis config. Network dash script. And if c, f, g, Dash, E and P's OS three, if someone asks you, where is that file located? As if it's in just a general question or if it's an interview question, you know the best way to answer it is I will run my fine command or locate command to find where that file is located. So practice those two commands, run men on these commands and look for different options that are you could use for these commands and see how easy it could become for you. 25. Wildcards: wild cards. What are while cards, just as his name says they are wild cards, meeting. If you play cards and, you know, in poker or blackjack, they do pick a card like a 10 or nine, whatever the card, and you could match it to any of the card to make your flash trail or whatever that you like. So that is kind of a wild card. So just like that in Lennox, we used wild cards to get the output that you were looking for. Ah, wild card is a character now. This is a definition right from the Lennox Dictionary that can be used as a substitute from any off a class of characters in a search. So there are many wild cards, but the most basic ones I have listed here they're three. The 1st 1 is the one I use most of time is asterisk, which is also referred to as a star. Ah star represents zero or more characters, anything that matches but that star placeholder. We'll look into that in a moment when we actually used the star wildcard in our Lennox machine. That we have question more represents a single character so if you have Ah, file name, text and you're looking for any files that has the word text. And you could use t e instead of ex. You could just put question mark in there and then t that means what ever files that had t e doesn't matter what's inside off the X and the last letter is X the tea, then it work. The 3rd 1 we have brackets, which represents a range of characters. So it's better we look at in done limits machine to understand them more deeply. I'm gonna bring up my machine real quick. Where did it go? Right here on long den hallways is myself and I'm in my home directory. Of course. Now, um right now these are the files in directories in Exist in my home directory. I want to create nine files that has a name that's a A B, C D one and X y Z and then same thing instead of one. It just increments the number 23456 I could do this. Touch a B c d one dash x y z one time, then hit up Arrow key again. Change wanted to changed to three and keep going. But don't you think it's cumbersome? A tedious It is. Right. So we use wild card to perform that task because you're gonna create nine files. So it's just a practice that we're doing for nine follows. Trust me. In a corporate environment, you're probably gonna have to create, like, thousands of miles. What you gonna do? You gonna just hit up arrow key and or type it 1000 times? No, that's not productive. So then what do you do? Use wild cards? So first of all I'm gonna do is I'm gonna remove these files one by one. Again. I could removed vile card as well, But let's created first and I'll show you how I could remove it. So I have two left now. I could use a wildcard to remove both in one shot removed, ABC wild card. So what is telling it? Removed everything that has a farm name that starts with a B C and whatever that comes afterwards. You don't care. Just remove it. Hit, Enter. That's myself here and you'll see all those two files are gone. Now I'm gonna create nine files and to create nine falls. I'll use the command touch as you know, the touches. A command to use. And then there's a wild card, another oil card that's called curly Braces. So I was creating filed A B C d curly braces one dot dot nine because I'm gonna create nine files. So this curly braces 1.9 selling create nine files that has digit one through nine and Dash X Y z. When I run this command, what do you think that I will have listed in my home directory? I will have nine files right here at the bottom. You'll see. I have nine files. Awesome, right? This is what you wanted to do? It is much more faster to do in the wild card as opposed to typing what by one. So let's use the gastric. It what? I just want to list every file name that starts with a B. C. You do ABC ass trick, and you will have all the files that starts with a B. C. I want to remove every file that starts with a B. C. You could remove one by one a B, C D. One and so on and so forth again. Very cumbersome. Don't do it. Your system administrator. You are smart folks. You don't want to use the commands one by one. What do you would use? You use a wild card so you'll do a, B, C D or a B. And to Astra the reason I picked the four letters. Because if I just pick a and hit Asterix, it will also remove any other files in my home directory that starts with a and which I don't want to do it right now. I don't have any file. So let's say if I create a touch A So now I have all the files and a so I just want confirm I don't have a so I don't delete any file accidentally. So yes, I don't have any. Father begins with a other than these. So if I just do it removed a Asterix ever removed all the files that starts with Kate. Let's check it. See, all those files are gone. Isn't that cool? Yes, it is. I love this asteroid because I use it all the time. I'm gonna recreate those files again by heard hitting up arrow key that will return my last ran command. Just confirm they're there now. What if I wanted to remove everything that ends with X y z? Same way removed. But this time we'll put Asterix in front off X Y z it enter. Boom! All gone. Awesome! I'm gonna recreate it just for the exercise off this lesson. It created nine files. Now we'll want to the next wild card. But is the question mark, The next question mark is telling it ls minus. L question Mark B C d pastoring. Okay, what am I asking here? I'm asking is gave me all the files that has whatever the character is the first, as long as the other characters has B, C, D. And whatever comes afterwards, these are the matching files because whatever the first characters weathers a or not, I don't care. I just want to make sure I will get the listing of the files that has B, C. D. And after the So that's how you use the question Mark and the last one we have brackets bracket is gonna tell me that gives me anything that has C or D letter in a file. It's just that simple either. See, either d either f or this and that. So you put all that stuff that you're looking for inside of the bracket and you will have all those files you see here. And it went so fast, I'm gonna put it in mawr. Put. I want to see one page at a time and you'll see it gave me. And it has a has be every file that I'm getting as either has A or B either has A or B. So that's how it works. That's how wild card works again. Now I want to get rid of all the files that has, um why x and y in it. Awesome. I have my wild card. I'm not gonna go into leave one by one. So this command is telling the show that go head and please delete all the files that has X and Y in it. And X and Y has to be together, Of course. So we do have these matching files X y, and it was good and delete it, and all of them are gone. So while card not necessarily is used just with LS or removed, you could use it that any of the commands you we have. You could use it with all the commands we have learned so far. Try it, try it with different commands. If it doesn't work, that's OK. Go online. Google it and try wild clad while Clark Examples Try them. Just get familiar with them. This will help you a lot in your job, I promise you. 26. Day2: Hello and welcome to Day two. Today we'll learn all about the living system administration and all the tasks that are related to manage Olynyk system. 27. 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 28. 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. 29. 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. 30. 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? 31. 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. 32. 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. 33. 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. 34. 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, talk, grip, short, unique and word count. Here are the six. They sick and very powerful command of evil learned 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 it will ask you for the password and you lock it. Now let's see who we are, where we 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 Seinfeld, which we did. And what if we wanted to get the first letter from each line? Teoh. To get that output, we have to use the 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 or you're gonna use? See, I said, well, 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 use 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 two 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 walk separates each column in a file. So in my father 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 in enough all pipe, and it shows whatever the way you want to show. What if you wanted to view that the second column, which is the last name you put simply too. 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 their column. 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 crop does. So if I wanted to grow up, um, the name Seinfeld inside, um, the file signed for characters. I didn't get anything. Why? Let's look why I didn't get anything because designed 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 of 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 do we sort it? 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 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 cat Seinfeld and you notice this, um unique. Um, 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. 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 a rookie 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 do sort. It will sort 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 use sword 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 Um, 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 elovich is 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 and Windows . It's gonna be so hard. You probably have to do text to columns, or I don't know if that works in Vendor in Ward, 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 output and give Put it in a different file, wherein Lennix 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 Denver. I really don't know how that works, and the last one is word count very hard to do to do the word count and windows. So there are so many different filters, these commands that you could use in the next. 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. 35. Compare Files: we're gonna compare to files how that is done. There are two very basic commands that that are used in Lenox. The 1st 1 is the diff, which is going to compare to Farr's line by line. And the 2nd 1 is CMP compared and it does bite by bite. We're gonna look at thes two commands by logging into our system will use a party session. And if you remember the police station, um, we would need the i p address off our machine. If you don't remember the i p address, you could go back into your, um, consul. You log in and you do you do if config pipe it more because we don't want to see the information going too fast. So I'm piping it to war and you'll see the I P addresses right here. You could put that I p address in your body and you will be able to connect to it. So let's minimize this. And let's see, we are sorry. Who am I? This directory on men? Women home. What's inside my Derek tria. Want to go into the directory Superman and see what's inside in Superman? I have I removed this fall I created earlier Is that this way it will be easier for you doing the same and recreated so removed. So Okay, so I am in this Derek tree home. I have sold Superman and I want you create a fall, um, called Superman characters. So let's do touch. Sorry. Not touch Echo, um, and the first character of Clark Kent and put it into Superman characters. Find Steer. Yes, it's here. And then go Lois Lane. Double Superman Characters Co. And Superman does do cat, and you'll see it has three lines. Clark, Lois Lane and generals are I want you to create another file. Call it character because women characters to so a barrel key Go back to the first while And this time I want to do same things him and do character to hit Enter. Then you'll do the same thing Don't sought to. And I know it was Lois Lee. Yes, listening character, too. And the last one is Jones are. But this time I don't want you do something so I don't want you, John Peter and enter. Let's check the Superman too. Okay? You see, the Superman two has your own Peter and the Superman, um, dash characters has general saw. Now let's do comparison. If you want to compare, Two Falls will do the 1st 1 with death and Superman characters would supermen characters to It's gonna tell you the first file right here has the generals are on it, and the 2nd 1 has your Peter. What if want to compare it? Superman. So, for men to again, you could do just tab or complete, and it will tell you the last, relying that 3 30 bites a testified difference. So that's what the to dip commands that we use in the next two. Compared to files, there is not an easy way to compare two Falls and Windows. So that's why, again, this gives us a huge advantage to do file tax manipulation. Lennox Again, I want you to do man command on both commands and camp and just learned different options that are available 36. Compress and uncompress: next lesson we have compressing and un compressing files. There are a few different commands that be used to compressing and compressed files. But first of all, there is a command that is used commonly in Lenox, and that command is called tar. What does tar do? Well, Tart takes a bunch of foz together and put it in one container or one file. You could say it's just like in Windows. You have a bunch of files and you sit them together. So most likely, the Tar Falls does not compress as much as the actuals Jesup command that Jesus is the command is actually compresses a vial. And then there is a command Jesup minus D or gun zip. These two commands are used to un compress. Ah, file. So let's get to a question. Our favorite question. Why do we need these commands anyway? It's a very good question off course up to answer this question this way is what happened to system crashes. It's OK. You try to resolve the issue, but you cannot. There is. You tried everything, but you cannot find the issue. You cannot get to the point where you know Ah, that's the problem. So what do you do? Are you gonna sit there and just, you know, try your endless outward to resolve it? No. What are you going to do? Is you're gonna call the support you're gonna called Red Hat or the operating system support. If you are running Santo s, then most likely you are out of luck because most of the center s has no support. So I hope you're running red hat in your corporate environment. When you are running red hat, you will get a support. So you pick up the phone, you call them, then what happens? They will tell you to send the files or logs to their websites. And sometimes they're so maney logs so many files that they ask you, you have to put them together into one file or one container, and you make put them all of them in one container. That is, when you doing tar or in lyrics language you could say tarring. You put everything together. All right. So everything is together now. Now that the file sizes huge, it will take so long to transfer. So what do you do? We actually compress it once we compress it. The file size becomes a lot less than its actual size. So we'll try all these commands in our Lennox environment one by one. And this way you will understand how these commands work. All right, Um, I am in my home directory and someone has asked me that. Send me all your contents off your home directory. So in my home directory, I have directories and files and maybe links and directories subdirectories in suburbs within subject. Is there more directors? So how do you would put everything in? One is we use a command tar and the option that I used to see the f you could look it up CVS option by running man. But I've been using these three option letters for a long time, and I know it will talk. It will compress it a little and put everything into a file. Then I would have to specify the name of the file that everything will come into. So I just put myself because this is my home directory. I'll just put, I absolve, I'll just put tarred the end. Why? Because this will identify that this is a tar file and What are what am I tarring? I'm tiring this entire directory so I could do home. I have solved this will tar everything in that. Or I could simply do the relative path, which is dot dot means tar everything or put everything that you see right now into Ah, file call. I absolved Qatar and I run it. You see all that messages come up on the screen, some off the message that you'll see tar file is archived. Non. Don't forget that. Don't worry about it because it's trying to tar itself. That's where you are getting their message. But anyway, when you get all that message when you run at X minus, lt are and you will see right here I have so Tor. Perfect. Yes. So now everything All the contents, desktop templates, public. All these files and pictures I have are all putting into this file. How am I going toe untargeted? Well, I don't wanna untargeted and the same directory Would all the fathers already exists? So what I will do? I will create a directory m k d i r. And I'll call it block, blah, blah. Whatever. Okay, the file, the deckchairs created. I'm gonna move this. I absolved a tar file in tube Law Directory. It's moved. Yes, it is moves. I don't see it. I will go into blah directory now. I'm in blood. Right tree. Just make sure to run Pwd. Yes. Home. I was all block. Perfect. Is the file there? Yes, it is there now. How, Antar? Meaning? Taking all the contents from this file and putting in this blood directory. There's a command tar, same thing. But this time out on X, the F extract everything. And this is the name of the file. While Ron it had enter. It will come through all these untiring falls. And now when I do, I am in home. I have solved block. And now when I do ls myself to you, What should I see? Well, I should see the exact same contents I have in my home. I absolved. I should see the same contents here. That it's confirmed. Bingo! Yes, I do see everything, right? Burfict. So I don't want all those contents in there. I'll go one step back and I'll do it. That's my salty are again here and you'll see I have the same thing here. Why do we need to keep two copies? But of course, was just a matter off explaining you. So let's go back in to block. And this time you'll see I have this file. I absolved. A target has everything. Now the size off it is to 72 58880 But it's huge. I want to compress it. So let's compress it with Jesus. Jesup IVs all dot are simple. Is that hit? Enter? You see, it took a little longer, but it did compress it. Just look at the size right here. Remember the size to 725880 Unless release my cell tr you see the file size went down a 018298 It means it has humming to just two for 67 This one has to 46 and eight. So, of course, this one was The size was a lot huge than this one. So it means it is compressed. Then the next command we have is G zip minus D or gun zip. What this does is basically un compress it. No toe. Do un compress. You do G zip minus D or again guns. If which is right here G zip or gun zip, I'll just use G zip and I absolve dot tar dot gz hit Enter now the father's side should come back to the same one we have right here. This is the original file size, remember? And yes, we did get original policy wise, so we have tar file VG zip, diddly compressed it the un compress. It will go back to our home directory. And we do have this blood directory and will simply get rid of this blood directory which is removed. Mines are for removing directory or rmd ir to promote blood. Director is not empty. So what we'll do, we'll do minus F to force it. I think my rmd ir myself does not work here, so I'll do our A minus R f This definitely work here. Yes, it does. It's gone. Director is gone. So this is how the tar is explained in simple words. I want you to try the tar fall to tar your own home directory, Jesup ing it or and then unzipping it. Or you could even simply take any fire that you like and Jesup it and see if it's file size reduces. And again, the purpose off these commands is if you went, if you have to transfer files from one computer to another or to send it to someone, the file size are huge and the trash will take a lot longer, and that is why we put them together into tar and compress it so it become a smaller and smaller, and the transfer becomes easier. 37. Vi Editor: 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. 38. 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. 39. 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 Space 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 B. I pseudo edits the It's at Sea Suit War File, which is a configuration file that allows users to add 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. You're letting 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 and 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 first word and then you become Spiderman. Let's eggs. L go back to our account. What if you want to become root simply to s you dash which we have covered many times and to 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 passwords to be authenticated. We are We're Spider Man. Let's go back. We are now route that school One step back, exit out and we are You are still that'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 route? Well, 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 commander 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 have solved to run all youse a command and you would put it right here. You put I of salt, um, that oh tap. And then you run pseudo command and you could become route rights to run any command. But we don't want to go at the user level. We will. 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 fall. 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, um, the rich group is veal, and but user is I'm so enter. How do you verify you group veal from Let's see group 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 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 40. Monitor Users: that's monitor user's. We have created them. Now we have to manage them because that's one of the basic job for any system administrators or engineer or a systems guy to monitor that uses what they are doing in our system. Some of the commands to mind those users are who who tells you who is in log in the two system. Blast W Finger and I. D. These are the few commands. There are many other commands as well. But these air the few basic commands that are mostly used in Lenox Environment, where you could monitor user's Let's look at our links machine by going into our Lennox Consul and run these commands to practice them. Cave your den. Let's clear our screen and see we are good of yourself and your in our directory. And of course, now you should know to type host name, and our host name is is the name off system. It's clear this the first command is who who is going to tell you which, how many people are logged in and end User I d. The terminal I D. And the time they were law then. So I have locked in and my concert my gooey. But with Colin zero and I have open up a terminal right here tells me the Pts s the terminal. So actually there and the time I opened it up if I wanted to open up another window so you do right. Click on open terminal so you'd open up another terminal. Now, when you type who it should show you three. The return mills that is owned by us. If so, what if I log in as, um Spiderman? So let's go to our party terminal and put in our I p address. I believe it's 1 80 to 1 68 $56 1 A one. It's $56 1 one. You could check that by again running the command if convicted, they said. So we'll open that now. This time you log into law Guinness Spiderman. Okay. And now it's clear this green and check. You see, we have four 123 war and the 4th 1 is used by Spiderman. So this is the main function or main purpose off the command. Who? Ah, the reason we run this command who all the time or most of the time is when there is a very high load in the system and you want to see how many people are logged into the system. Next, next command we're gonna learn is last. It's closed. The one in the back Last Command tells you all the details of every uses that been logged in from since the day once of a new type last had enter. You see, everything comes up in the screen so fast, I wanted to see one page at a time. Then how do I do that? You do last pipe it and more it. And this will tell you the last time they used the logged in his Spiderman off course. But this is the name. This is the use of that law been, and this is the time I loved. And it's telling you it is still logged in, and it tells you every user that's been logged in and every user been logged and rebooted the system and whatever happened to the system. So let's say if your system reboots or shuts down or crashes unexpectedly and you suspect someone was logged in and you want to see what time they logged in which I p. They used to log into what date and time the logged in all the information is here. If you wanted to, you have If you wanted to see the first column off your output off last, this is your last right last and you run that and you want to see only the first column, all the user names only. And what commend you would run? This is a kind of pop quiz. You do last. Pipe it on dollar one and you get the 1st 1 Now you just wanted to remove the duplicates than what do you do? You do short. That's what's so and you type unique. And then you will see only these other uses that been logged in. I've saw Reboot that. So that's also a protocol that is used to log in Spider Man. And there's another user, W T. M P. Another command that we learned as W W. Works pretty much the same as who, but it will give you a little more information than who gives you the log in time, the idle time and what this process is being run by. What user gives you a little more detail. The next one, his finger. When you run finger, um, now Finger command is the commander is that is added to your system. So it's not. It does not come with your distribution. You have to add it. It's a program. It's a very powerful program. Is it's basically does the trace off your user where coming from, what kind of particle is using? So you could you need to install that, so we will leave that out for now. The next one is I D. And you had I d e. Without the use of name, it will give you the information about your own self. Use the name, your group I D and what part of other groups you are. If you run, I d and you do Spiderman, then it will give you the information about the other users. So there you have a few commands to monitor the users. I hope you will remember them, and I hope you will practice them again. The way to practice is to run them different options. And how do you find the options is by running man and do who, and you will find different options. And I would highly urge you to please use different options just for practice 41. System Utility Commands: system utility commands. These are very basic commands 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. Bunin Lennix. 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 you name about the opening 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 anger on these commands one by one in Lenox Machine. When you logged into the gooey to the consul, 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 the information that are automatically viewed. Vidal running any command. But what if you are logging in through the putty 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'll 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 I p address you punch in 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 and you wanted to find out what time is it or what dated it? It is just type date. Tell you. Today is Tuesday, March 13 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 they 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 many 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 limits 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. UNIX flavours. So it's good to run your name. If you want to know more details about your 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 Jews Erben P W d. If you wanted 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 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. Can 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 their lunch of commands that Lennox has. What if I wanted to know how many total commands are in Lenox? Very simple. You do? Ls minus l. And if you remember you, Piper, you do board count minus tell. This would give me the total number of all these lines. That coming up is telling me there are 597 commands that are inside off this latest 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 now when I was born? Let's say for for training I'll do Cal September 18 1977. So all types of number 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 gone in 60 and I'll give you all those months, uh, starting with, of course, January ending with December. That's what the cow of command is used for. Next Commander, you have as clear 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. D c it enter? No, If you wanted to plus to enter give you four. What it from 2 56 times. Greed 21. That's the answer. So this is this the basic help? Later? 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 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 options. 42. Day3: welcome. And finally, today's the last day. Day three. Today we're going to court the Advanced Lennox System Administration. It's all about this at vast level off systems administration that includes the process management, the Pash management, how to maintain your system. What is a colonel, how to do a simple shell scripting and some other advanced system related tasks. 43. 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. 44. 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 45. 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. 46. Changing hostname: changing linen system. Host Name Host Name is the name off your next machine that is assigned during the first install and often time Ah, machine is repurposed or decommissioned or use force something else Then you have to change its hose Name to change the host name The command at his use is host name C T L Dash Set dash host Name, space, new host name. This is the command. I believe there is no dash in the middle, but I'll try it out. Host names said Dash Ho's name. And, of course, the new horse Name the files that are used to save the new host name in Lenox. Seven OS version. It's etc. Host. Name the older version off Lenox, which was version six. The configuration file for host name was at Sea Sis Config and Network. So again, let's try are changing our host name off our Lennox machine in our lab in war mint on the next machine. And right now, when you type host name this is the name off our machine my first Linux os. Now I want to change this host name to a different host name because my company came up with the new standard. Now, every machine has to comply with the new standard requirement. So that's why I wanted to change it. So in order to change a host name, you have to first become root. Cause route is on Lee, the one who has the power to do that. Okay, well organised route. All right. And now I'm gonna run the command host name before I run this command. I just wanted to tell you the file that keeps your host name information is at sea. Post name It's for see when you when I can't. This father has my host name. I could go into this file directly and modify this host name and then reboot the system and at work. Or I could just simply run host name CDL Command set, host name and the new host name. So I'll put it the new host name. Um um, New York City host one, let's say, because my machine is located in New York City and it's a number one host, so I'm just, you know, making it up to comply with didn't standard my company came up with All right. Perfect. So once I have it. I run the command. It ran. So now when you do cat at sea host name, you should see the new host name there. Yes. You see that New York City host one. But when you type host name, it gives you the host name off your new machine. But if you notice here your prompt My first Lennox os has your prompt has the old horse name. Why is that? Because this shell that I'm logged into this shell has to be restarted or the whole system has to reboot in order to read the new host name that we created. So the only way to do that a simple reboot. I'll just run, reboot or another command for reboot is in its six to this time tolerant in it six and will wait for the system to come back online. Give it a couple of minutes. Got my login prompt a log in sometime. The virtual machine will take a little longer to come back online depending on your laptop speed. So I'm gonna go and right click open terminal and you'll see now it has the new host name. N Y c host one. So this is how you change the host name. Um, do you guys know how to change the host name and windows? Well, I think you might. If not, then you should look into it because as administrator, you will have to work a little bit off in the windows environment to you. Just go into your my computer, right Click on properties and change the host name. So it is simple and windows through the gooey. And Lennox is just running one command. It's simple here as well. So I'm gonna change it back to my original host name becoming route. So this will stay consistent. And this time I'll just modify that seahorse named Paul. My first Lennox Lewis, right? This is my original horseman. And then you run horse named this time it will still give you that. Because the process that does the host name changes. That process hasn't been restarted. The only way to do it is to restart like host, name the command every run before. But anyway, I'm just gonna simple go ahead and restart, reboot my computer again so the changes will take place and put my system back to my original post 47. 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. 48. Terminal Ctrl Keys: terminal control keys. Several key combinations on your keyboard usually have a special effect on the terminal. Regardless, if you are logged in with the position or you logged into a terminal through within your counsel, these control which is controlled CTR is the key on your keyboard are accomplished by holding the control key while typing the second case, if you doing control, hold onto it and then type the second key. For example, control C means to hold the control key while you typed Letter C. The most common control keys are listed below that are used in the next. 1st 1 is control you, which raises everything you have typed on a command line. Control see, stops or kills a command control. Z suspends a command can control the exit from an interactive program. I will try of each of these keys one by one. Okay, we are route because we have found exit out of it. Clear it. CD. Go back to our home. Clear it again. The control key. That's it. If you were typing PS minus ear for up mark. Sorry. Um, oak print, dollar one. And you're typing a long command basically and you realize this is not the command you have to type, so you could hit back key and it'll goes a raise. Everything. One character at a time. Of course, it's gonna take a little longer. Or you could just simply type control and hit you. Ever raise everything you have typed? So that's what control you is useful. 2nd 1 is if you are in an interactive, um, program, let's say you running top. And now you see, you don't have your prompt back to get your prompt back. You could type control. See, So controlled C is one of the keys that you're gonna be using a lot more than other terminal control keys. Because every time you find yourself stuck and you cannot get out and you're not getting your prom back type control, see to get out, then you have control Z control. Z is if you are running a process and you stuck in that process, Control Z will kill that process, and it will get you out of it. In the last one, we have control de controlled the once again it does exist. You are from an interactive program as well, which is running. Let's see if you are running B C, which is a binary calculator. You plus you're doing two plus 10. Enter. You got to do quit to get out off it or you could just simply to control. The many of these interactive programs have their different ways to get out. Sometimes quit work sometimes simply key works. But control De is the one regardless off rich, interactive program. You're in that control, the will get you out. These are the few control the control keys that you should remember and Lennox environment will help here who are stuck in anywhere. 49. What is Kernel: the next Colonel. Do you know there is a kernel in every Lennox distribution or UNIX distribution? What, exactly a colonel is? It actually interfaces between your hardware and your software. So let's look at this diagram. Here, you will see you have at the bottom is the hardware and what others? Hardware hardware is like CPU memory, hard disk and any, um, outside hardware peripheral devices. Then you have Colonel. A kernel is a program that is stored inside off your operating system. It's like a program, a command that keeps on running. And what it does is it takes the commands from shell and shell. What is a shell shell? Is anything like a gooey Davey having windows or a gui in Lennox? Or if you don't have going Lennox, we have terminal that runs bash shell or sea shell, which will cover later on. So when we are in that bash of seashell terminal environment, the execute commands. The commands are being forwarded to a colonel, and it's kernels responsibility to talk to the hardware that's inside off your computer, and then you on top of that, you have a browser, send mail, all the application that we're only calculator, calendar office or any limits related applications. And, of course, on top of that is are the users and that is you. So Shell and Colonel together, that's offer built together in one package, and that is called operating system. And that operating system is any operating system like Lennox, UNIX, Mac or Windows. Every operating system has that little program that actually talks to your hardware and anything that is a shell, which is written in C programming languages. Well, that shell or that those applications are actually the software. So this is what the real colonel means, and we really need a colonel in any operating system to talkto our hardware. 50. What is Shell: shelter. What is a show in this lesson will cover about Shell Hollow shell works and how you grown command within the shelf or how the environment it's set up in a show. So what exactly is a show show is like a container like you know, you have, like a top aware in your home or any kind of containers that holds your environmental information inside off it, it's interfaces between users and colonels or offering systems. So you have built an operating system, and then it is provided a platform you to execute commands again. Ghulam Windows is one of the platform and and now have been is offering system. When you start up a gooey, you execute commands by running. But double clicking on a program so that go into face is your shell. In Lenox. When you don't have a gooey, you are given a terminal show or cli command that is your show. To find your show, you could Aronica man like eco dollars, dollar and zero that would tell you what shell you are in. And you could also get a listing off all your shells in your Lennox distribution by running the command cat at sea shells. Your shell is also inside off, etc. Password that is defined inside off the file you and windows. Gooey is a shell in Lenox, Katie Eglise a shell and let S h which is shelled Bash sector. All these are the show that is provided to a user again. We're looking at this diagram again, and we are second from the top. You'll see the application that talks to the shell and then shell talks to Colonel and Colonel is the one that is telling hardware what to do. Let's look, look at our Lennox machine and we'll see how we could find our show. Open up a terminal real quick and when you do cat. So when you do echo dollar zero, it tells you you are in bash So you could look at the available shell that is installed in your distribution by doing cat at sea shells and tell you all the shows that are available . And when you look at Etc Password, cat, that seat password and you'll see in my user name, which is right here. It tells the shell is all the way at the end that I have a defined show, which has been bashed. I could change the show if I want to tow a different show, but I try to keep it consistent with other users so that what the shell does, and we'll cover the later in the later lessons how we could talk to Shell to create scripts and other things to automate our tasks. 51. 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. 52. 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. 53. Aliases: aliases. What are those aliases? Well, in real life, Ellis is like a short name or easier name or something easy to remember. So I'm sure everybody has, Ah, nickname when you were growing up. Um, and just like other people who are very famous, Just look at 50 cents he has his real name is Curtis James. And, um, there's another one like another example would be pitbull. His real name is Armando Paredes. Eso Those aren't the real names, but they're Ellis is is shorter. So the shore aversion and shorter name they have is because easier for people to remember them since the same way it is his work in Lenox to So there are very long commands that you'll run almost every day. But you need a sure aversion off it. And how do you create a short version or a short reward for it is by creating aliases. So again, this is very popular command that is used to cut down on Lenti and repetitive commands. And some off those examples that I have listed here we will cover those example one by one in our legs machines that they say you exactly know what how leases work. So let's go to our machine and we'll go into our or courtroom machine Consul Terminal. And we will try these aliases command one by one. So the first Commander having Ellis is is ls so often time If you want to know all the files of in minus l and a option to listing or a for to also show the head and files, we will run the command ls minus l eighth or a L. And you will see all the listing of the files and directories we have in our home directory . And this is our home directory. Simon, run that command. Often time, you'll forget the option. So what do you do? Will create an alias, So we'll create a low Yes. And instead of just lsl cree tell, um, equal coat ls minus a l coat clothes and just hit Enter. Once you hit, enter and you don't get an error message back. It means that aliases created Now, how do you verify for screen but simply running an alias? But l l was our alias and let's run it. And there we go. We got the up as if you were running whole command. Let's create another alias, the other areas what it will do. It will, um, do the PW d for you And also do ls for you. So to command in one shot that you would you don't have to run twice. So do pl pl I picked the word just for print working directory and Ellis equal coat pwd and you separate each command with semi Colin and Elvis and coat closed. You hit enter. And now and I'm gonna tie pl I should get pwd and L s command running. So first let's clear the screen and I'm gonna write pl And there you go. So the first command it run was pwd Next command ran ls So every time I log into the system , I'll just do pl And it will run those two commands for me. Let's keep going on and let's try our 3rd 1 which has three commands. Who am I host name and PWD. So I want you to create the alias on your own. I'm gonna go onto the next one. Um, next one is it will list all the directories inside off my home directory. Um, I groaned a command ls minus l and a group, but And the cap right here that you see, which is on top of number six? That's it's telling the group group everything. Um, that starts with D. So run that and you will see it crept Everything. I'm in the output that starts with D. So off course, anything that starts with D is what is a directory. So that's what it's getting. So I'm gonna create an alias for it, and I'm gonna call the deal I o r equal coat Vellis minus l and I'm gonna grow up it the d enter clear the screen and let's see if it's working by typing de ir. And yes, it is working. Then I'm gonna try the last command in my list. So what last Command is doing? Sorry, I just have to move this little mawr and resize this. It'll see the last command. So what last Command is doing is, of course, it's doing DF minus h. Let's run DF minus h. We could output your petitions information the size where's amounted and how much is used. And the next command is doing the F at Mons. Age is printing it's walking. The last column. I believe he has dollar six close and you will see it is showing you let me make this smaller too. So it's listing all everything that is in the last column, which is a column six. Now I want to get in that output. I want to get on Lee the 1st 4 characters off this output. So I'm gonna run the command again and I'm gonna do cut my A C one through four. It enter. And there you go. This is what it's telling me that the last column, these air, the petitions that I have in my Lennox distribution. Sometimes you do want to run that command just to find out what petitions you have. You don't want to look at other other information that DF minus it gives you. So I'm gonna create an alias for that. So I'll just hit a barrel key off course to bring the command back. I'll go back all the way to the two beginning of the line by hitting the left arrow key. I'll type ale. Yes, and I'm gonna name this alias as just d equal. Of course I have to put quotation here. Double coat. And there is one little thing you have to change here is you see here dollar sign in Lenox Dollar sign has what meaning If you guys remember, dollar sign is actually outputs of variable Whatever that you have variable inside that you Attash scripting it actually puts it in there so it will think that it's a variable too, so we don't want to tell its variable. So how we could, uh, change that or how we could tell Lennox not to think it is as a alias. Eso he has a variable toe put back slash after putting the backslash move or liver to the end and hit quotation close that enter and it created my alias. Now if I do d again, that's clear the screen. I'm gonna do a D again and very good. It's doing exactly the same thing we wanted to do except with with all that long, tedious command you to have to run it all the time. So it's much easier. Every time you log into the system, you type D and you'll get your information. Isn't that cool? It is very cool because that's why most of the time people use aliases, so it will be easier to remember and do the tedious work in a very short amount of time. Now, where are those aliases created? Once you type aliases without any running creating a new command, just type releases Hit. Enter. You will see right here. It will give you all the aliases that I have created. He knows right here. This is Want dessert to another one right here. And then there are another one right here and the last one. No, this was other ones that are already created. It's already there by the system by default. It's already there for us, so I don't have to touch it now. What if I wanted to remove that alias from the list off? Elicit a creel simply, There's a command to do. It is a new alias and you type the alias name. So if you notice the first a list we have, you have his name just deep somewhere. Just type deep it anay listed. Let's see if it still exists. You just type bilious and see if the alias exist there or not. It does not. It's gone. There's another alias de IR until Alias as well. The I R. And then I'm gonna try to check if it's there. Nope. It's gone. So it's just that simple. It's masking something, it's telling. Is creating the a shortcut key for you to run in Lenox environment? 54. 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. 55. 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. 56. 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 57. NIC Information: nick information. What is the Nick Nick stands for? Network into face card. That is something that is attaches to your computer, your desktop or your laptop. If you look at the back off your laptop, you'll see the little port where you connect the the Ethernet five or six cat five or six cable to it. That's the card installed in your computer and the port that is associate ID and are attached to the card. That port is cold Nick in Lennox or in Computer World. It's called Nick. An example to find the information about the neck is that you run a command eat tool followed by the name off your neck. And how do you find out the name off your neck? I think it think about How do you find out the information about your nick? You run the command if config that will give you all the interfaces off your computer if you run. If config, you will see other nicks as well. What are those? Well, there is one of the nick that you will see that shows up is L O L O stands for loop Back Device is a special interface that your computer's uses to communicate within itself. It works as a diagnostic and troubleshooting and to connect servers running on the local machine. So it's like if you could say, a private communication within itself, then you have another Nick that you probably will see in your machine. If it's a virtual machine, it's V I R B o The stands for Virtual Bridge zero interface is used for Nat Nat stands for network address. Translation. The virtual environments sometimes use it to connect to outside number, so I don't want you to really focus on the R B zero or even L O because you will be seeing this. But there is not not main function of this. The only function off the interface that is used to communicate to other computers is a different the third interface, which is usually labeled as if it's Oracle Virtual, it's E N P, or if it's a regular server, you're probably gonna see e T. H 012 or soul. So we will run this command eat tool in our environment and see how we could get the information about our interface. A little go into our Lennox machine And this time I want to log into my system using our consul. So the concert Or you could use Putty session too, if you want to. So let's see if I have ah petit session. I'll just execute the party section right here. But in order for me to run party section, I need the I p address. How do I find the I P address? How do we find it? If Gun fig now, you should be comfortable enough to run this command all the time. If config I'll put Mawr because if it's ah if it doesn't fit on the screen, it will give give me one page at a time and the i p address that I have for my interface Is this one night to toe once 68 Towanda 12 I log in as myself. And in order for me to run the Eat Tool Command, I have to be route. So I am route. That's clear the screen. Let's get rid off. This one minimizes. Since we already have the putty, let's make it a little bigger And now we'll talk about the interfaces again. How do we check our interfaces if conflict As you can see, we have the main interface right here, which is the Wanda is used to communicate to other computers or outside boiled, and it has I p assign. The next one is L O, which I have already explained, and the 3rd 1 is V. I. R B r zero, I already explained in my slight I want to get information off. We are B R o. So let's say Eat Tool and V I. R B r zero and it will say link detected. No. So forget that then. Next one we want to do is eat tool. L hope. Linked. Addicted. Yes, but there's not much information that's out there because it's the systems its own interface of We don't have to worry about that. The one that we have toe be concerned with is eat tool D and P zero s three. Where do I get that right from here? See this interfaith? This is a name off my interface. So I will run each tool followed by the name off my interface and I'll hit Enter once I hit Enter, I have right here my command. I'll put start from right here. This is what is telling me that setting for interface is supporter ports is teas TTP ah supported link modes. It supports 10 which is 10 meg 100 Meg and 1000 make. What is 1000? Meg. It's one gig. So my interface supports one gig of traffic. Nowadays, if you're running your computer on a very high speed network computer, you will see 10 gig right here. So a few things that you do have to get out of this, um, command eat tool is one that's ah, whether it's, um, link mode is 1000 or 10,000. Second, you have to know, Of course, the speed is 1000 megabytes, which is the same as this one. Then you need to know it's duplex is a full half duplex. These are the things you have to provide to your network administrator, because when your computer is connected, toe a switch and switch has to be configured for your port toe. Allow traffic to come in and leave your server. Your system you're never demonstrated will ask you for that information, so be ready for that and remember the command to find that information. His eat tool and the last one is linked. Detected that your interface link is up is active. It's not down. If you are troubleshooting it, you could find it if you see no hair than it means, it's something wrong with your never card. I tried these commands, run man command on each tool and try with different options that is given and see what are the options gives you the exact information that you're looking for. 58. 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 59. System Upgrade and Patch Management: system upgrade or patch management. This is a very, very important topic. Very, very important lesson for this. For this training, you will be upgrading your system from time to time or applying patches to your system. Um, on a quarterly basis, depending on your company's policies, there are two type of upgrades that happen in Lenox operating system One is the major version upgrade, which is from 5 to 66 to seven. And if you don't know what worsen off Lenox via running right now, then I would tell you right now, stop everything again. Stop everything and go back to your Linux VM and find out what version you are running and you will find that out. How you could do cat at sea, red hat dash release or you name. I say, Are there different ways that we have talked about previously? So anyway, just let you know. If you don't know if you forgot, that is fine. The version of your running in a lynx machine is seven, and the minor off that version is $7.4. So there are two type of upgrades. Major versions 56 or seven and minor version from 7.3 to 74 or $7.1 to $7 to. Or that stays within the same channel, which is, like seven all the way from 1 to 56 everywhere where it ends. The major version does not get you cannot get upgraded through the young command. Minor version can be up done through jump update Command major words, and you cannot do how you could do the major version. Upgrade Well, you have to back up the entire server, build a new server from scratch and transfer files. There are a few other ways that you could do it, but trust me, it's very cumbersome example to do. Your update is simply running a command jum Space update an option minus why? And the reason we have minus why is because this is telling the opening system. Every time you're gonna prompt me to install a certain package, don't ask me. Just install it. So, for every question, my hand, sir, is yes, there is another way to do that. Update is update and upgrade. Now what's the difference between update and upgrade? Upgrade? Deletes packages when you have a package, let's say you have an anti P package or http package and you, you, you did jump upgrade. It will delete the old package, which is, let's say, http 0.5, and it has a new words in http 0.6 So it will delete that old package, and it will update it with the newer package. So that's a difference. Where, as upgrade preserves, it preserves the older packages as well. Why? Because it is a good practice for some system administrators to keep a little packages in case they has certain off their applications don't comply or don't run with the newer version off the packages. So that's why sometimes people have to roll back to its original pash updates. So system upgrades and patch management. This is just ah, quick, um ah lesson for it. I will go into my limits machine again to try out few of these commands. I want to go in as putty. So in order to go in s putty what you need, I am keep typing this. So this way you guys would know these this command or networking off limits machine. So there's that I be you put in the i P address in the Lenox machine. I already have the party open. Who am I? I'm my son route to just minimize the council. And now I have open buddy. So the first thing is right here. Um Yum update again. When you do the jump update, it will preserve old packages whereas upgraded elite old packages. But before we go any further, what version do we have? Have you checked that out? So you do. It's he had released. We have version major version seven and minor version doll for So we will do Young update. We will not put Minus Why? Because I will show you when it will ask you if I want to proceed. So just do jump update. It is actually going through all the packages that require an update. And it is telling you right here at this summary. Let's scroll up that these air the packages that do require some off them to be updated. Every package has a dependency on other packages. So if I'm installing package ABC, it might requires a package off X Y z Ah, just like in windows. If you are trying to install one package, it might require you to install java as well, or flash or some of those other packages. Similarly, limits works the same way. When you're installing one package, it does have other dependency, so it has to have those packages updated as well. So that's what it's saying. That it will insult BIPAC, just new ones. And there are more updates there. 209 packages off it, So that includes five pack that includes the dependency as well as the updates of the packages. So we will say, Is this OK? Yes, it's OK, Go ahead. And yes, if I had put in space minus why it would not have asked me to put in my Y or would not have waited for me to put why? So I'll why as yes is the unloading packages, it is going through the update process off 449 packages that in these two update this will take quite some time. So what I will do is I will fast forward this so at least you could view it how it is going through. Each package update wants the packages. Updates are done. Then it will do to clean up and and remove any lingering process that's out there. Okay, The system has been updated and it is complete. We did not get any er messages. And by the way, I should have mentioned in the beginning this. Make sure your system can go outside, and every time you need to make sure you could just simply ping google dot com It does go to Google, but just to make sure we have throwing one. So it is going outside and it is pinging every time you see it's coming back with 64 bites from this machine, it means it has Internet access and it could talk to the server outside. If it cannot, then you definitely have the issue and network issue and first checked those before you run the junk command because the JUM command is actually going to the Santo s repository to download your packages or update your packages 60. System Run Levels: system run level. These are the run levels in the system in an operating system that brings the system in a different mode. Um, and Windows, you do have, ah, safe mode. That's one of the motor system brings up and it doesn't have networking is just bring you a single user mode and another up ring system have different more just like that In Lennox, we have six different kind off system run levels. The main run rap levels that are significantly used many times. But system administrators is the 1st 10 Every time you type zero, of course, proceeding with the command in it. I an I t followed by space and zero it was Shut down your computer or halt your computer completely. It will not reboot. Oh, completely powered off. Then you have in it. One. It is a single user, more usually a liest as s markets as our upper case, as you could type in its space s or a per case is, it will function the same way as if you type one. Then the most commonly used is six. When you type in its space six, it will reboot your system this command is equivalent to command as if typing reboot the other level run levels or from level to which will bring the system in multi user mode without no working. There won't be any network. You cannot communicate to other computers. Then you have Level three, which is a multi user mode. Vid networking, which is most of the time, is the one that is used by us, but it does not have gooey and the run level five, which is multi user mode with networking and with gooey, um, for our environment. We do have a gooey so most of time Peyron level as five. But if there is no going, you gonna see that you will be rebooted into their own level. Three. So we'll try a couple of thes run levels in our Lennox machine. Let's log into it to run any off the system, run little commands. You have to be route. You could verify it if you are ruled. Of course, by running, who am I and the first command? You have to run zero, which is in it zero space minus zero. This will completely shadow my computer. It's not gonna re but I have to go into my oracle worship box to power it on. Or if it's a physical server, you actually have to be in front off the computer in front of the Iraq. Wherever is, it is racked in the shelf. You have to power on to bring it back online. If you type in it one, it will bring down the system and rebooted back in a single use. A mode. Sometimes you do need to bring your linens machine two senators a moat If you wanted to troubleshoot some issues or reset a password or so on, and then we have reaped in its six, which is just like as a few typing reboot. Then the other unlevel is multi user 23 and five. Now how do you find out which wrong levels you are in the command to find out? Is who Space minus R R. It's the option that tells you what you run level you are in. You will see here. It's telling you you are in run level five. Why? Because they're gooey. If I wanted to bring it into run level in a three Vadodara gooey, I could do in a three, it will reboot system and there you go. See? It brought it back to run level three. There is no gooey. I wanted to type it in my log in credential. And now if I type who minus are you'll see now that the run level has changed three because there is no gooey. If I wanted to just type in its six, it will automatically bring the system back online, and it will be automatically in run level five. So that's about system run levels. You could try every single option that you see it here, tried out, practice it and, of course, one man on in a command. 61. File Transfer: file transfer. There are many commands that are used to transfer files from one computer to another. As long as you computer is connected in the network, you could transfer files or directories for once over to another. Some off those commands are FTP, which stands for file transfer protocol. This is one of the old legendary commands that are used in many different up operating system. It is still used in Lenox, Windows and Mac and many other offering system. This command is used next one we have SCP, which is a secure copy protocol. And then the next one is our sink command. This command is mostly used by system administrator to perform ah files backups from one system to another. They could schedule those commands through Cron job to copy all those sink our sync files. So let's look at a few off these commands in our links environment. Here we have our links machine and I'm logged in as myself. So when you want to copy ah, fire, let's say I want to copy file that is called my first file. The first thing I have to do is type FTP and the machine named that it's going to, Which is a destination server. Okay, so as an example to ftp ah, file from your server to another server I have logged into my legs machines myself and we'll see who you are. You are self. So before you try to do a trash for just see if you could paying Google because without Internet, you won't be able to transfer any file now. I could paying Google. It means my computer is on the network now. Where do we have to trash for? And what do we have to trash for now, of course, you do need a server that is running ftp demon. Meaning your so for your client and the server that you're trying to connect should have FTP demon running. And a demon name is V s ftp deep for this training. We do not have an extra external ftp, so we will try to connect to the red Hat FTP server just for training purposes. So the command to run is FTP space FDP dot red hat dot com and you will see as soon as you're connected it will ask you for the past words for the user name and password. So you provide the credentials that are given to you by the red hat, Um, support. So when you end to the password and user name, then you will enter the command put and the final aim. And that's how it will be Trash Ford to, um, to the FTP site. Now, if you're trying to trash for to a server that is not running the FDP demon. So let's say in our environment we have PS minus CF and we'll grow up for FDP and you will see there is no FTP Damon running right so as a training purpose will cry to trash for FDP toe our own server. And our own server is local host or the name off our host, which is my first Lennox host legs os. So first, if you ping my first Lennox, the less you'll see you are getting your apply back, right? So it means you are connected to your own machine. Of course, let's clear it out. And now I try to do ftp my first Lennox os and they use hit enter. You will see it says connect ftp connect Connection refused. And why is that? Because my server are My Lennox machine is not running the demon and the demon is the one that listens to the incoming traffic. So anyway, this is how you run the FTP command and you transfer the files. And again, the purpose off doing FTP is if you have a new issue with your system and you troubleshooting it and you involve, um support, whether it's red hat are sent OS or windows. Whatever the support that you have involved, they would ask you to send the locks and they will give you the FTP server account information and credentials. So you would have to run FTP Command to send the logs over. The other commander he wanted to cover is SCP. Now, SCP is basically copping ah, file from one machine to another and of course, this has s in front of us. It means is copping it securely. So let's take an example off a file that we will want to transfer. Let's see, was directly were in. We're in our home directory and let's say I have a file called right here la la land. So I wanted to take this file copy it from machine A two machine. Be now. Of course, we don't have machine be where you want to transfer. So we was use our own machine and pretend that it's a remote machine. So the way it works is we'll do a CP la la Land, which is the file that I'm trying to copy. Or so where am I trying to copy? Or I'm trying to copy over to another machine remorse machine. So we're pretending they're more machine is, which is our own machine. Of course, my first Lennox owe us. And then you put Colon, which is first, is a host name slash Where are you copying it, too? So let's say I want to copy it to my home, my user directory and the director. You want a copy to, Let's say, Seinfeld, Seinfeld. It's a directory of wine to copy that file into that folder. So once you have that command hit enter and it says could not resolve host name my first Linux os, Uh oh, yeah, because I have miss build first. These are the type of things that you probably would have to troubleshoot you enter. Um, my first, the Knicks O s. I still have coming up. So what we do is we'll just take out this part. So I'm just gonna What I'm gonna do is I'm gonna copy this, and I'm gonna paste it and then hit. Okay, So it is saying that connect to host my first Linux OS port 22. Connection refused. So it is refusing a connection. Why is it refusing? Not sure, but let's try to do local host. Yes. So you put in the password, of course. Your own password. Because you're logging in as yourself on the machine as well. This is your own password. So once you put in the past where you will see it, say's LA LA Land 100% completed seven bites and the right, and it's 70.5 kilobytes per second. This is amount of time it took to trash. So did transferred. Now let's where if I if Seinfeld directory has the LA LA land file in it. So which director I'm in? I'm in home. I absolve, Let's go to sign Fill. And now Ellis to do ls myself to your and you'll see. Yep, right here. This is la la land. Very, um, Just to confirm that's it etc. Host Um, my first Lennox O s. So it has one eye to 1 $61.14 Okay, so now I know. So this one, I have hard coded my host name with 19 to 1 68 $1.14. And I'm sure why didn't work? Because my I p has probably changed by now. So it's probably hating some other device in my never and you see Yes, it Now my limits machine is one about 13. And the reason I was not able to connect because $1.14 is probably one of my other laptop or my iPad or some other device in my home network that got that got 14 i p. And when I ran the SCP command, it was actually going to Dad device Perfect. It was a very good example. Now, you guys learn as well that how important s a TSE while host father's, I'll go ahead and modify that have become route, and I'll do V I at C host, and I'll just take these two entries out. I'll just leave these two in close. So now if you run that command that we were trying to run before hit a barrel. Kia Paro Key. No, Sorry. We work as locked in his herself. Right. So now when you run that command, you will see it will give us a prompt. They go see right that this was the one, right? You hit. Enter. See? It's connected. The next one is our sink. And this will tell you exactly if I just type are single. Tell you how you go. Copy falls. If you just want to itemize the changes, it will also tell you the progress Self it so this command is used. Um, it's a very famous command now, and it is used by many system engineers to do and to perform while systems back up. 62. Message of the Day: message off the day. It's simply a message that will appear on your screen. Every time you log into a limits machine, it will tell you Hey, welcome. This is this machine. It's host. Name is this And please be careful whatever the commands you run or whatever the message that you wanted to be seen two for the user. So maybe you have experienced something when you when you actually connect to different servers or more servers, the first thing comes up eyes. A security warning. They'll tell you, please be careful. This is a very critical server. One of the commands that you run, everything is being recorded Everything. So message with the Tate Dake file is located in etc. M o t d. It stands for message off the day, so let's see how it works. I will log in to my linens machine and the file. I'm gonna modify his V I at C m or T D. Right now you see, it's empty. I'm just gonna type something here. This is our first Lennox machine. We used it to practice Lennox commands. If you are not authorized, then please exit out just that three lines that I want to type. That's save it. Which is calling, right. Quit and bang. Let's verify if it has everything that we type. Yes, it does. Now, how do we verify that every time you log into the system, it will show that message? We will. We will check that. We will verify that by logging in through from our party section. And, of course, if you want to log in from pretty session, you need to know the i p address of this machine by tapping if config and the I P addresses 1 90 to 1 68 for $1.14. I'm gonna go into this machine 19 to 1 $68.1 dollar, 14 enter. It's just a security message. You could just Yes, log in as yourself are as root they go see you. See your message. It says right here. This is are I made a mistake with our but that's okay. You got my point. Right? And this is the exact same message that you typed in that file. So, um, try that and changed the text and see if it works for you or not. 63. Disk Partition Commands: disk petitions. In this lesson, we will learn Ah, couple commands that are used to show which ah file system has been petitioned. Where is the petition to and what is your local file system? Disk size? The first command is DF, which tells you your disk information. How much disk is used? Where is it petitioned to? And the 2nd 1 tell you how much the disc total size is and how many petitions has been created out of the disc. So let's try both off thes disc for a commands in our Lennox environment. The first command I want to type is just DF and just by typing DF the first column is tell you where is this file system is coming from the size use available and percentage and mounted. You could run DF Minds H command and you will get the human readable output which will be in gigabytes percentage in which where is it mounted to? The next command is F disk F disk without any option is now gonna give you anything so often times it is used with an option minus l. When you type f dis minus l, you will see right here the disc size. Let me do, um or let me make this a little bigger. Okay, So when you eat type F dis minus l, you will see that the discus petition to slash dev slash sda Just one petition and it is 10 gig off space. And right here it is telling you it is mounted on SDA one, which is Lennox, and the other one is sorry. The 1st 1 is to swap into the one is the actual disk, and it gives you some more information about the desk. What, as each size mounted before, If you notice here the 1st 1 the 2nd 1 here. It's a center west wop and I created a swap for one gig. And that's what it's telling me that that sec through the first petition, which is right here it's mine monte or swap, and the rest is mounted on our Deb mapper cento US route and which is almost 8.5 kick. So that's why these files these commands are used for it is very useful when you want to add a new disk to your system and then after adding it, you want to initialize it. You want a petition it and you wanted to mount it to you to your mom points