Linux Operating System: A complete Linux guide for Beginners | Ankush Choudhary | Skillshare

Playback Speed


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

Linux Operating System: A complete Linux guide for Beginners

teacher avatar Ankush Choudhary

Watch this class and thousands more

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

Watch this class and thousands more

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

Lessons in This Class

51 Lessons (3h 21m)
    • 1. 000 Intro

      1:24
    • 2. 001 Linux Introduction

      2:23
    • 3. 002 Corse Overview

      4:03
    • 4. 004 Defination

      1:54
    • 5. 005 Why Linux

      3:09
    • 6. 006 Brief History

      2:04
    • 7. 007 Major Linux Families

      4:45
    • 8. 008 Choosing Distro for this course

      1:26
    • 9. 009 GUI vs CLI

      2:52
    • 10. 010 Installation and understanding virtualization

      3:45
    • 11. 011 Installing VirtualBox

      0:57
    • 12. 012 Installing Linux Mint

      1:01
    • 13. 013 Creating First VM

      6:21
    • 14. 014 Installing Linux Mint

      3:38
    • 15. 015 Additional settings for VirtualBox

      3:14
    • 16. 016 On Works (alternate if can't use vm)

      2:54
    • 17. 017 Look around in Mint UI

      4:55
    • 18. 018 Linux File System Hierarchy

      7:47
    • 19. 019 Introduction to Terminal

      3:56
    • 20. 020 Linux Directory Commands

      7:20
    • 21. 021 Linux Directory Commands Part 2

      5:25
    • 22. 022 sudo

      3:31
    • 23. 023 Getting Help

      4:16
    • 24. 024 Printing Contents of Files

      8:11
    • 25. 025 Coping, moving, renaming Files

      4:13
    • 26. 026 Editor nano

      5:13
    • 27. 027 Editor vi

      8:57
    • 28. 028 Search for a file (find,locate)

      2:27
    • 29. 029 Grep, Comparing Files

      2:46
    • 30. 030 Pipe and sed

      2:07
    • 31. 031 Checking File Size

      2:50
    • 32. 032 Compress:Decompress

      2:53
    • 33. 033 System Info

      2:16
    • 34. 034 System Utilities (Date, calander, sleep)

      4:13
    • 35. 035 Utility commands (clear exit shutdown)

      2:17
    • 36. 036 uptime,alias

      2:29
    • 37. 037 User Managment

      7:07
    • 38. 038 Changing ownership of file:folder

      5:55
    • 39. 039 Changing user permissions

      2:49
    • 40. 040 Changind permissions using num code

      3:14
    • 41. 041 Networking

      3:39
    • 42. 042 Check your IP

      3:12
    • 43. 043 Setting up bridged betwork in VirtualBox

      1:54
    • 44. 044 Firewall

      8:28
    • 45. 045 Memory

      2:27
    • 46. 046 Process (ps and top)

      2:35
    • 47. 047 Killing a Process

      5:22
    • 48. 048 Writing and running code using terminal

      4:22
    • 49. 049 Installing Apache server

      5:07
    • 50. 050 Uploading your webpage to server

      3:51
    • 51. 051 Shell Scripting

      6:57
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

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

13

Students

--

Projects

About This Class

Linux is the number 1 operating system in the Corporate world. Industry's most powerful computers are Linux based. Linux is a popular open-source operating system that’s easy to use and highly secure.

Every time you use Google or Facebook or any other major Internet site, you are communicating with servers running Linux. Most DVRs, airplane, and automobile entertainment systems, and recent TVs run on Linux. Also, if you are using an Android phone, you are using a flavor of Linux.

Linux offers low-cost servers that can run almost every major web development language available. With the availability of cloud computing, the Linux market share is skyrocketing.

In this class, you’ll learn what really matters and you’ll get the skills to get ahead and gain an edge, the best investment in your career!

Meet Your Teacher

Class Ratings

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

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

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

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

Transcripts

1. 000 Intro: Hello and welcome to the course of Linux operating system. My name is Alicia three, and I will be your guide through this course. I have a lot of industry experience of deploying, managing, and creating Linux-based, so was at systems. So I will be your guide and tell you how you can learn Linux and then you can master it within one week and be able to create your own systems, manage them, and do all the things necessary on a Linux system. I have divided this course into nine modules. We will start from the very basics for the seed. What is Linux? Why Linux is used? What is the history of Linux? We will start from astonishing and Philip place where you will be able to deploy your own servers. Then see what are all the commands? What are the things necessary to learn to become a good system administrator? And finally, we will reach to a point where we will be able to write programs in C, run them took my line width may be able to deploy our service like Apache. So we'll host our own websites on the syllabus. So let's begin our journey together learning Linux in one week. 2. 001 Linux Introduction: Welcome to the course of Linux operating system. Before we begin the course, Let's have a look at what we are going to cover in this course. We will start with a very high level view of the Linux operating system. We will look at all the different components of the operating system. And we will see what are the various places we use this operating system. Then we will learn about how to install Linux onto your computer. If you have a Linux computer, than find if you have Windows or Mac operating system, then what we're going to do is we're going to create a virtual machine and install Linux over there. If you didn't have knowledge about these things, do not worry. We are going to cover all of this in this course. And if you do not have enough resources, do not worry. I'm going to tell you other methods where you can do all the labs of this course. Then we will go through all the major commands of the operating system. And we will learn about dome, which is necessary to become an administrator or a Linux system manager. Okay. So who this course is for? This course is for anybody who is an IT and has heard about Linux operating system or needs to learn it for the job. Or hue ID student. Or someone who just want to explore and learn about Linux operating system. Discourse to not require any kind of prior knowledge of id. So do not worry if you're totally new to this. That will take you from the beginning. And we will try to take you somewhere where you can actually be a system admin. Okay? So I'm really excited about this course. And just keep in mind, if you're new to this. Do not panic. It's not a race. Take your time. We will cover each and everything. And we are going to be learning a lot of things. Thank you. 3. 002 Corse Overview: Course authoring. So what are the things which we are going to go through in this course? We will start with a basic introduction. Then we will go and look into Linux Directories and a little bit of history. Then we will see how we can download, install, and configure a Linux machine. Then we are going to see how the file system N-terminal work. Then we will see the working of files and directories. What are the commands, how we can access them? Then we will look at the system utility commands. Then we will look at networking. Then we will look at processes and memory. Then we will look at advanced features. So we will look at some of the advanced things also in this course. So module 1 will be very basic where we will see what is Linux definition of it. Why are we using Linux? And then we will look at some of the brief history, major Linux families, Linux distributions, and how to choose a distribution for this course. Then we will look at differences between working in a command line interface and graphical user interface. In the next module, we will see how we can download, install and then run it in and virtual machine. Then we will look at Linux Mint. Then we will look at how we can create our first virtual machine and what shall box. Then we will look at some additional settings of VirtualBox. Then if you cannot install VirtualBox and then run via VMs over there, how we can walk around in, on walks. In the next module, we are going to have a look at Linux Mint desktop GUI. Then we will see the hierarchy of the file system, how the file system works in Linux. Then we will see how terminal books. Then we will go through basic commands of how to get into a directory, get out of a directory, what the pseudo mean, and we will see how we can get more help. In the next module, we are going to look at how we can print contents of a file, how we can copy move rename. Then we will look at different kinds of editors on Linux like the nano editor VI editor. Then we are going to see how we can search for files and directories, how we can look at them, how grep command works. Then we will see it by command, cd command. Then we will see how we can check the file size, how we can compress an uncompressed files. And in next module we are going to look at system utility commands. How to check system info, system utilities like simple things like date, calendar, sleep commands. Then we will see how we can shut down over computer, clear the terminal up, buying a lice, user management. All these things will be covered in this course. And in the next module we are going to have a look at networking, how to check over Ib, how we can configure a bridge network so that our machine has the same IP as our network. How to configure firewalls and give permission to different ports. Then we will have a look at memory and process management, how we can kill a process, how to check free memory, how we can work with different processes which are running in the computer. Then we will go and learn how to do some advanced things. Like we will see how we can run and compile C program, then how we can create an Apache server and host our own website over hill. Then we will look at SSH, how we can do SSH. And also we will have a look at how we can write our own shell scripts. So all this will be covered in this course. So let's just start and dive in. 4. 004 Defination: Just like Windows and MacOS, linux is also an operating system. So what an operating system does is that it sits on all the hardware of the computer underneath all the other application. What that mean is, let's say I want to use an application in my computer, let's say a browser, or I want to use Excellent. So all those different applications require hardware resources to run. So to manage all those hardware resources and to allocate them, that does software requires this resource right now. It does not require that. So all the management of all that hardware resources is done by the operating system. So Operating System is a very important software in a computer. So you will say that yes, I have used Windows, I have used a macOS, but I have never used Linux before in my life. But let me tell you, you might have used Linux and you don't even know about it. Do you know all the Android devices are actually based on Linux. Also, a lot of smart devices, like digital storage devices, cameras, variables, video recorders, or of them actually are using a software which is based on Linux. A lot of smart cars these days, luxury cars have an operating system under the hood, which is actually based on Linux. So next time when you're using one of those devices, think about it, that that device might have Layland under the hood. 5. 005 Why Linux: A lot of people ask that when we have this popular operating systems like Windows and MacOS, why should we use Linux? And that is a very good question. In recent times, because of some things which Linux brings to the table, it has become a very favorite OS of developers. And let's look at those things which make it different from other operating systems. One of the main reasons is that it is open source. What that means is that the source code of the OS is publicly available. So you can make changes into the OS, make it customized according to your needs, and then use it. So this flexibility is a very big reason that it is very popular amongst the developers. Other thing is that it is set to be more secured. How's it more secure? Because we have lot more control over the operating system. So we can make certain kinds of rules for the users, customize it according to our need and make it more secure by applying more layers of security. It also has a very large community of users, which are developers. That is why if you encounter some kind of a problem, there would be a lot of support from the community who would have been working on that. That is why it is a very nice community to be in. If you have a problem, there will be someone. There might be someone with the same problem and they might have found a solution for that. That is where everyday there are new solutions coming on the platform. Now let's look at industry is how much Linux is being adopted by the industry in today's market. So in 2021, all the 500 supercomputers of the world are running on Linux. Other than the other then a two websites, all the websites among the top five websites are using Linux. Off the top 25 left sides of the word. Most of them are using Linux, just barring to 96.3% of world's top fun million servers are Linux-based. 90 percent of the cloud infrastructure is powered by Linux. So Linux is very popular amongst all the hosts, all the major websites, and also the major Cloud providers. So that is why if you are in IT industry, you must know about Linux. 6. 006 Brief History: Let's look at history of Linux and how it came into existence as we know it. So travels. When he was a student at university, wanted to create a operating system which was similar to Unix, but was open to use. So he actually wanted to replicate a system which was very similar to a Unix. So that is the reason why all the major commands which we use for Linux are similar to Unix. In 1991, he released his first version. Later, he released the polished version of the Linux kernel in 1994. Meanwhile, Richard Stallman of FASFA, or free stock for foundation, was making a force to create the Unix-like operating system also. So he was creating utilities for operating systems, which was for a Unix like system. Later, both of them combine their efforts and they came up with the Linux operating system as we know it today. Because Linux was open-source, lot of developers, bigness kernel and created their own operating system. Soon the market was flooded with a lot of operating system which were based on Linux. Many operating systems which came into market, survived, some did not. But today we have a huge variety of variations of the operating systems with different styles of menus, lot of different features. So a lot of variety to choose from. So amongst them, very popular ones are Ubuntu, Linux, Mint, Fedora, when shadow. So in the next lecture we are going to look at the major families of Linux operating system and understand that or how they differ amongst themselves. 7. 007 Major Linux Families: Major Linux families. So let's look at the major Linux families which are out there. So majorly there are three families which are very popular. Debian, Fedora and soils. So popular operating systems like Ubuntu and Linux Mint are part of Debian. Other operating systems which are very popular in industry like Red Hat, CentOS or echo Linux are part of Fedora family. You might also have heard of open source or SLE is they are part of the SUS family. So I've just told you about these different OS, but you still do not know what is the difference between these three families. So there is not much difference between these families because behind they're using the same Linux kernel. But the major difference is off the package management system. So let's have a look at that. So all the operating systems of the Debian family use APT or advanced packaging tool or deep EKG. So these are the major two patching tools used by these distributions. That is why they are part of Debian family. So what is a packaging tool? So if there is some software which we are creating, so we package it using this kind of packaging tool that is a PD, then it is, it is part of Debian family. So for different term families, we have different packaging tools. That is all the difference between them. So when you would be installing a soft fill into your Debian system, what you will do is you will use the API decommissioned. So one example of that is if you want to update your system, you will write sudo APT update. That will update Debian systems. Okay, so let's have a look at other families. Let's see the red had family. So Red Hat family mostly uses RPM or Red Hat packaging manager. Or they might also use a young that is yellowing updater modified. So these are the famous packages which are redhead family uses. So let's say you want to update your redhead system. So what you will do is you would write a command like sudo yum, update and that will update your system. So if you want to understand how these different families for that is the different package managers that they use. So there are a lot of other families like Arch Linux, SUSE Linux, and they have their own packaging managers. So that is why they are called different families. Other than that, the EU, all of them use similar commands to do all the other tasks. If you have to open a file, the command is same. If you want to delete a file, the command is seen only while you're installing something or updating something. You will use the package manager of that particular family. I think. Now you must be more clearer how the different families of Linux work. So there are a lot of popular distributions of Linux out there. Open to CentOS, Debian, Fedora, mint, x equal to our Linux, Open SUSE, red hat. So you want to know about them. You would say, how can I understand all of these complex things? Nothing is complex amongst these. So what you can do is you can just, you know, whatever name you like. You can just Google that, read about it is tall. One or two versions of Linux. Try them out, get familiar with them. And if you don't want to do that, don't do that. Just pick one. Linux does not matter because under the hood, they all use the same kernel. And you will be doing the similar kinds of things with all of them. Most of the times. Of course, if there are different operating system, they're designed for some specific purpose. But it's sort like you can host a website in one, but you cannot In other. So they're not very vastly, like drastically something is changing amongst them, but they're designed for some particular task. So do not get worried about a different operating system flavors. Just pick your favorite one. Just pick anyone. 8. 008 Choosing Distro for this course: Again. So if you're still confused about which district to use, please do not be confused. So you can go around Google and CVS destroy you like. But if you are thinking it will take a lot of time, I'm too new to this. I am unable to decide. I'm confused. Confused. Do not be I will tell you what kind of a district I will be using. So I will be using a Debian based distro that would be Ubuntu or mint. So if you're still confused, you just pick Ubuntu or Min for yourself. So it's not mandatory to use them. You can use any of your liking, but it will help her like if some time I might be installing something over there are updating. So that will help you because you will have to write the same command. Otherwise you can use annually strophe your liking. So what we're going to do in the next lecture, what we're going to do is we're going to install Linux on our own computer. So if you have a spare computer where you can install it, good. If you do not know, then what we are going to do is we're going to create a virtual machine in our computer and their VR going to install Linux. To not be worried if you do not know anything about these things, I will walk you through each and every step. 9. 009 GUI vs CLI: One of the differences between other servers and Linux OS is that Linux servers do not always have a graphical user interface. Compared to other servers, like Windows servers, where you always have a interface where you can just look at the icons, click on them, and navigate through that. So that makes it very easy. So I can just look on these visible elements and understand what they might be doing. Like this looks like a meal. So this might be an application where I can send and receive meals. If I look at this cross button, this might be for closing this application. So it is very easy for us to understand. And any new user can spend a few minutes inside any operating system and understand how it might be walking. Whereas when we have a command-line interface, it becomes extremely difficult because if you do not have prior knowledge of those commands, you cannot just navigate through the system and understand what is going on over there. So you will need to know all those commands. And that is why it is a little bit difficult to work around. That is where you need to learn all of those things. Most of you doing this course, our hair, probably for the same reason to learn all those commands. So we will have a deep look into all the major commands and tried to become submit server admin at the end of this course. So one question arises that why do we have command-line interface and why can we not have a graphical interface when we do have graphical interface for the consumer versions of Linux. So the argument provided is that if you have a graphical interface, it does make things easier for you to understand. But the graphical interface takes a lot of memory and other computer resources. So weiter waste resources on these kinds of things rather than these resources should be used for our applications to run. So this is one of the main reasons. And other reasons are like Go, it is more or less prone to mistakes. So when you are very hands-on with all the commands, so there are very little chances that you will write a wrong command and something wrong will happen with the system. Though, human error can always happen. So that is why learning commands also gives you a confidence that whatever I'm doing, like you are very confident, yes, I notice you're just not playing around with the systems. So let's try to learn all those commands. So for that, we need to first install Linux into our computer. So let's install and quickly start learning all those commands. 10. 010 Installation and understanding virtualization: Let's install. In this module, we are going to install Linux in your computer, and then we are going to do the later modules we have. We will run all the different commands and learn a lot about Linux. So if you have a spare computer lying around, you can install Linux over there. But what if you just have one computer where you are running your primary OS and you cannot install Linux over there. So I'm going to tell you a workaround. What we're going to do is we're going to create a virtual machine inside your existing computer and install Linux over there. So how does that work? Let me tell you about it briefly. So we have softwares like VirtualBox and VMware. These softwares are called virtualization softwares. So what the softwares too is that we have all this hardware in our computer, like the RAM, the CPU, the hard disk. All of those hardwares of operating system manages and gives two different softwares which we are running. But we cannot have two operating systems over there. So yeah, there is a problem. So how this hypervisor software helps? Hypervisor is the virtualization software. So how does that help? It will take a little bit part of the hardware, whatever we will allocate like one GB RAM, two GB RAM plus some hard disk and plus some of the CPU. So it will create a machine like it will behave as it is isolated computer. And we will, when we will try to install Linux over there, though, a Linux operating system will think it is a computer and then it will grab all the hardware. So this hypervisor actually manages the hardware in such a manner that it can create a computer inside the computer. Okay? So even if you did not understand it, don't worry. We have to learn Linux, so no problem over there. Okay, so what it will do is it will create a computer inside your computer. So what are the things we need to keep in mind while installing a virtualization software is that if you have eight GB or more memory, very well. Even if you have a four GB of memory, virtualization will be possible. But if less than four GB, it would be very difficult to run virtual machines over there because, you know, in very little of hardware, you cannot do a lot of things because we have to have resources for our main computer. And we also need to have resources for the computer we are going to create inside it. Okay, so that's all. Next. Which Shofar should we download? So I'm going to use a VirtualBox via I'm going to use VirtualBox because first of all, it is free and it is open source. And secondly, it supports a lot of voice. So it has a very good TO support base. So you can also install and run other operating systems, different flavors of Linux or Windows. You can even make go Mac machine. You can do a lot of things in VirtualBox. So what we are going to do now is we're going to go to Virtual Box website and then install it in our computer. So let's do that. 11. 011 Installing VirtualBox: You can Virtual Box website or you can directly go to Virtual Box.org of a hill. There would be a big banner of VirtualBox. Just click over there. It will redirect us to the page where all the listings or VirtualBox for zones is them. So whatever operating system you're using, just select it. So I'm using macOS, so I'm selecting macOS. If you are using a Windows machine, just select windows over there. Okay. Okay. Then it is just asking me if I want to allow this website to download something, I will just allow it. So it will start downloading for me. Then the downloading is finished. We just need to install this software. You just have to follow the simple steps of installing any soft feel. Nothing else needs to be done. 12. 012 Installing Linux Mint: Let's now download Linux, ISO, which we are going to install it in our virtual machine. So what I'm going to do is I'm going to download Linux Mint ISO. So what I need to do is I will go to Linux Mint that site. You can simply Google and then go to the next minted website. Then click on the download button, scrolling it a bit. So here it is telling us different versions. I will just simply select the Cinnamon one. And here all the specifications are there. So it is a 64 bit software. You can select any of these solvers. All of these servers will be, you will be able to download the ISO. I will just select the first one. And my download will start. 13. 013 Creating First VM: Now let's create our first virtual machine, install Linux or would there and start working with it. So what we need to do is opened VirtualBox application, then gotten new. Not give us a prompt and asked for us to give a name to the machine and just simply naming it Linux. Okay? So you get the selected Linux system. Automatically decide a folder for us. You can change the location, is machine is getting created. It will automatically detect the operating system you are trying to install it, limit something else vividly selected. But if you are living at Linux, it will just detect that you are making a Linux machine. I can just name it main pulse. But then also understand that I'm trying to create a Linux machine, which is actually Linux Mint is one of the west. So that is why it is directly selecting open to form the option. Okay, Now, let's continue it. Now we have to select the amount of memory we want to give it to this machine. So you need to give it at least one GB or threat. You can give a more also. So I have a lot of tram, so I'm just giving it a contributor. So it just works. Again, I will click on Continue. So do not change anything overhead. Just by default you can select it, create a virtual hard disk now, and just let it be. And you're gonna create this setting also, it is asking us the kind of disk image we want. Just a do not change it. By default, it would just let it be VD and VI up keeping it dynamically allocate. That means that it could be the size, could be varied, that is dynamically allocated, that isn't fixed size, we have a fixed size of the hardness. So select dynamically allocated because if it does not require a group of white space for it. So it is just a Dellinger. This would be created, so it would be created in this location. So you can check where it would recreate it in your computer. And then you can also change the size. So by default it has kept it tangible. You can do it for MDG, B2B, B2B as well. What you think you can give. But the minimum requirement would be like a dot ncbi. I will also not make any more changes. I'll just make it friendly to me because I have extra space. Okay? So don't ever click on Create New. So it has created a machine. That means it has allocated resources, which are virtual resources, but they act like a real computer that I will have hard disk, RAM storage. All of those things, if I wanted to change is off this machine, I can right-click on this machine and then click on settings. Over here, vehicle. Click on different kinds of settings. If you want to make advance changes to this machine, we can make them like, there are a lot of options in children. Like I can choose the name of the machine. I can click on Advanced. And eight snapshots things off this machine. But right now if you host system, and then here you can see that what are the peripherals attached to this machine? Like sloppy optical drive, hard drive. If I don't need a operator, I can remove it. Okay. These are the kind of things that you can change. I can click on processes and see how many processes are allocated with this machine. And indeed it has one CPU, but I can increase it. So if you have the capacity of increasing it, you can do that. You need not make it 50 or Ben GPUs and CPUs. You do not require much of CPUs, but so smooth functioning of the machine. And I will click on display. And here I will just increase of video memory to the 128 MB because that would make it the graphics to being working smoothly. So there is not much lag file using the machine, okay? So these are the basic settings which we need to do. Now. For this machine, I find that voice to be installed over there. So what I'm going to do is I would click on storage and I will just mold my operating system has available. So how would I do that? Here, you can see there are different buttons. Let's click on this plus button. I will click. And here I will click on the Add button. And you can see there are a lot of operating systems which I have in my computer. So if you have downloaded Linux Mint, you will just never get to the place we're operating system has been downloaded. So most probably it would have been downloads. Just select the Linux Mint, the bassoon which we have downloaded. And then click on Open. And then click on. Okay. So it will just add it as an optical drive. So then we'll start the computer for the first thing. It will install this software from here. Lake v actually install the software on a physical computer, seen via it will be able to install it from here, because it will think that I have under CD, which has Linux running on it. Okay. I would click on, Okay. If it says all the changes which we made, like V in Callisto video RAM of the increased number of vCPUs. And we have an optical drive Verdun of an image of the operating system is there. Okay, so in the next video, what we're going to do is we're going to boot the machine and install the operating system. 14. 014 Installing Linux Mint: We have created our first virtual machine, and we have meant the desired changes into the machine, which we wanted to do, like adding the extra vCPU. And we have also attached an optical drive which has Linux Mint image on it. So ven vivid Buddha machine for the first thing, it feels like we are actually opening a computer with the disk drive of men inside of it. And it shows the menu where we can install the operating system from them. So I will simply put the machine. So you can see there is the window where it is showing us the options of a hill. So it is showing us that all these options, I will just simply select startling expanded. So it is logging in, learning the Linux operating system over here. Lot of Linux-based operating system have this feature where you can look around the soft fill without installing it. So here you can produce all over him like the System menu there or the other softwares are there. They are This computer magnesium. So all the directories and folders are overhead. It is very similar to Windows. So it is not very much difficult to understand how the white folks, but the main thing is to learn the commands over here. So let's install this. So how we are going to install it? We just fill him, simply click on the histone Linux machine. So it will ask us to select our language, have a select English. So it will ask us to select the keyboard layout. So either use a USB keyboard, you select whichever keyboard layout you are using. So here it is asking that if you want to install all the multimedia plugins to run all those surface. So you can click it also. That is not required for this course, but if you want to select, just simply selected and we can continue. Next, it will ask us if we want to do a fresh install or if you want to do something else. So simply select areas on, do a fresh install and click on install now. So it will give us a warning. We just have to click on Continue. So it just gives a warning that you fill. It has all the data. So in this machine, nothing else system, it is a virtual machine. I have no way. But if you're installing on a computer, very important files, audio, DVD, backup, 10, only, install any new operating system on your computer. Now we have to select the reason for VR. So I'm currently in India, so I'm setting India. You can select your country. So at the time of recording via a country that is where that helps. No, I have to create a user, so I will just name the user anguish. Now it is asking us to set up a password. I will just give a simple password. You can give whatever password you want to give the password. And click on Continue and it will start installing the software or the here. Okay? So you have to just read by the software gets installed. And when it is done, we'll start exploring. 15. 015 Additional settings for VirtualBox: In this video, I will be talking to you about some additional settings you can do in your virtual box so that you can work in a battle mano and flawless wave. So what you can do is when you have created your machine, you can go up on your machine. And in your machine, what you can do is you can click on Devices and then you can click on shared clipboard. Here it is. It would be default, disabled, but you can click on host to guest gets to host or bidirectional, just select bidirectional. Also, what you can do is end devices. You can go to drag-and-drop and enable it. Okay, so what this will do is it will enable dragging and dropping off some files from your host operating system to the virtual operating system, which is this min toys. Other thing but you need to do after this step is you can also copy paste by selecting the shared clipboard. So you will be able to copy paste from guest to us, to the main OS and from manos to the guest OS. But the only thing is that you need to do one more step back. What you need to do is go into devices. Click on, Insert Guest Additions, city Mitch. And one thing you didn't remember, you need to mount a disk if it is not already there. So if you had already removed the disk, you will again need to add a disk, but going into virtual machine's settings. Otherwise, if a disk drive is already there, you need not do anything. Just follow the steps in this video. It will ask for my password authenticated. So it will take a little while. After that, it will ask you to restart your machine. Was a machine is restarted, you will be able to get benefit of this extra benefits where you will be able to copy, paste some small information like sub-command or some URL or these kinds of things from your host machine to the guest machine. So let's say you wanted to copy something from your host machine to the guest machine or from the guest machine to the host machine, what can you do? You can just go anywhere now. Like I will just go to my main machine, which is the host machine. I will copy a big command which would be when notes on somewhere from Internet, wherever it is. I will just copy it, copy. And then I will go to my virtual machine, that is a test machine. I will go there, click over here, and I will just space it. So you can see I'm easily able to copy things from our main machine into the Watson Machine, paste them, and use them however I want them to be. Okay. So this is a nice little trick which you can use. So you can do other things also like dragging and dropping stuff and other things also. After doing this, as I told you, just select the menus, the Fe, I have told you to. And you will be able to do all these things. This will make your virtual life that is using virtual machines. And all those things are much, much more smoother and easier. 16. 016 On Works (alternate if can't use vm): You do not have access to a Linux machine and your computer does not have enough resources to create a virtual machine. What do you do now? So what you can do is you can go to on-wards website. So it is a very nice website. The URL is on vox.net. Just go over there. And what it helps us to create a virtual machine and directly let us use it from our browser. So we need not do anything. Just go to invokes.net. And then you just have to scroll a little bit and select operating system of your choice. You can use the reno S or any other ways. I will simply select Ubuntu because it is a very easy to use and family operating system. So I would say you can go with the operating system like a 12 or Alimentarius, just click on run online. So it will take a little while to start. So after we click on Start button, it will take a few seconds. It will just show us the timer also. But after that, a machine will be created for us where we can try all of the commands. So it's saying you're ready, okay, I will just click on Enter. So there might be some ads, just close those apps. And again, a little bit of settings it is required to do. So after it is done, we'll be able to enter for machine. So try it out. If you do not have enough resources, just go to browser, search on walks outside, and just try creating a machine. It does not cost anything for trying out. So do not worry about that. It's just free and I did not even needed to sign in or do any of those things. And you can see this machine is up and ready for me. It's just showing me some ads on the site. So what I can do now is I can just open terminal of a hill. I'll just and just open in terminal. The terminal is working fine. I can just do any simple command and see, it is showing me that my username is onwards, that is the user. Let's just create a file. So I just created a file and you can see this virus came over here. So it just works fine like a proper computer. Just try it out. So I will see you in the next video where you would have set up your virtual machine, either in your computer or online, and start working with our commands and learn Linux. 17. 017 Look around in Mint UI: When you first log into your machine, this is the screen that you would be valid. And here it is saying, welcome to Linux Mint. Fun advice. I would like to give you a basis that whenever you are creating a virtual computer, tried to give as much RAM as you can give. If you have a four GB or less RAM in your computer, you do not have much choice, but tried to give two GB of RAM with the virtual machine. If you have a attribute higher, you can easily give four GB of RAM, and that is sufficient. You need not give more than 43 of dram for the tasks which we are going to do in this course. So let's look around into the way of this operating system and see what all things are there for us to see. So I'll just close this. So welcome message is just welcoming us into the system. So on the bottom left corner you can see there is a M, like the Start menu in the windows. Here we also have a menu. So all the applications are hill. You can directly navigate into them. There are some quick shortcuts like the power of the Start, log the screen. Do some directories, do the terminal or the command link, which we would be using extensively in this course. Then we have a settings menu and we have a browser and other things. So let's see what else we have. On the right-hand side, we have a block, then we have a battery indicator. And we have other notifications like sound, MacBook and other things. Just like Windows, it is very similar to that. So here we have the backstop. You can just right-click and choose a duck stop as we doing other operating systems. On the top left corner you can see there is a computer folder. Just like a computer or my computer on Windows computers. And it is very similar in appearance to Windows in those primers. So let us try to open one of these folders like the computer. So here you can see we have all the thing, so drives which are attached to this computer. And on the top right corner we have the cross button up-close application. We also have the maximize and minimize button, which we have in the other operating systems. Similar to that, we also have a minimized, put them using this Minimize button, we can just many ways the application and treat all got sitting in the bottom taskbar off the computer. I can just click on the icon on the taskbar. And again, this application will come on the screen. So to maximize it, I will just use this Maximize button. And I can also resize it by using this button and make it smaller. So these are very basic things which you must be knowing. So whenever via in some directory on the left-hand side, we have all this shortcut icons from which we can directly according to various that are present in our computer. We can sort them in different mammals. All those things which are very standard. If you have used a computer in your life, you must be very familiar with those things. That is why I'm not exploiting them a lot. Some nice things. Our head are like this slight bubble, which you usually don't find in Windows. You can just resize any icons. So let's see settings menu a little bit. So I will click on this button and then click on the Settings icon. So the Settings menu is very similar to any Mac machine. So because they are very similarly designed, that is why those settings Spaniards very similar in most Linux distributions. For US, Mint is specifically designed for the consumers. Often those computers, that is why we have grass button and all those minimize, maximize buttons, very similar to windows over here. So we can do different kinds of settings like Diamond did applications. We can even change background from him. So I would just click on it and just select some other background. So you can import your own images also over here. If you want. So you can select a wallpaper from here and that will be reflected in the background. So you can choose anything that you like. And that's all. So you can tinker around with different settings. You can play around with manuals, check them out, see how they look, how it is different from your operating system which you are already using. Spent 15 minute, half a novel that familiar with these things. Then we get into the commands. 18. 018 Linux File System Hierarchy: Let's look at Linux Directories. So all operating systems have a lot of data, which will be computer-generated data, a lot of user data, log files, and every other thing you will connect, peripherals, various kinds of data would be generated. So afraid operating system has a matter of keeping these files in directories. So like Windows has its own system, Linux, which was designed to be very similar to Unix. It has its own system. So it is very similar to the Unix-based systems. If you have used a Mac operating system, it is very much similar to it. Linux follows file system hierarchy standard. So here what we have is the root directory and all the other directories are inside of it. Like the home has been been useful, Dev EDC, OPD, media. Depending on the distribution you are using, there might be some other folder also, like the CD ROM or the run folders. Okay, let's start by understanding what each of these directories mean and what other kinds of files which are stored. And then so the root folder is defined by the forward slash. And what are the kinds of files it has? It has, it is like the top-level view and all the folders are inside of it. All the other directories are inside it, which are the bins, EDC and other directories. Next is the bin directory. What does the bin directory has been short for binary. So it contains all the binaries, which are the program files or the applications which are needed to run the operating system, like the Alice or the cat program, which is needed to list out all the files or to print out all the of which are inside of phi. So these all vitro system related files, binaries are stored inside this folder. Next is deaf. So all your devices like your keyboard, your mouse, your webcam, every of those peripherals which we, you connect to your computer would be inside those for them. So in Linux, everything is defined as a fine. So all those drivers for these files would all be in this formula. Next is EDC. So there is a lot of debate about what does EDC stand for. Some say, it is this, that some say it is just et cetera. So Linus, who was the creator, the Linux kernel himself, default that it actually means, et cetera only. So all the extra files which you would not we don't know where they would go, would be in this folder. So mostly it contains a system by which would be common for all the users. Like if we have a particular setting or five, which would be for a specific user, it would be in the user's name. But if there is a file or configuration, which is therefore all the users, which is common, like the disk configuration files, valid user list, grows, Ethernet, host, et cetera, do all those things are inside, etc. What does live has Libby short for libraries? So other libraries would be inside it. So what these files are used for? They're used by other files or programs which are impinged or sbin. So any program which requires some data which will be inside the library file. So they can just access it and use it. Next is boot. So what does a boot has? Mood has all the booting system required files, which are required by the computer when it boots up. So all those files would be inside it. Next is home. It is very important to understand how homeworks, because all the use of files and directories are inside hole. So if any user is still its debt out would be in the name of the user. So if I create a user named Lucas, his data would be inside the folder on cosh and would not be accepted by other users which might be in the computer. So use of one will not be able to access files of user two. And user two will not be able to access finds refusal fund. So they are protected. So that uses multiple users can use the same computer. Whereas an administrator might be able to have rights to access all the files of all the users. So we will look into it a little bit later. Next is a Monday. I'm Andy does is it stores all the fines like for floppy, for CD ROM, all those drives and devices are inside a Monday. So if you connect any kind of a device in your computer, which is a storage device, it will just detect it and it would be inside this folder. Next is PROC, which is which contains all the process file system files, which will be like a process number if you want to know it, it would be incented proc other kinds of logs would be stored over here, which are system required files. Next is Brock. So what does broke has? Broke has all the system created five. So all the process files, processed numbers, ids, those would be here, all the log files, which are the things we'll create for behavior. So if you want to get information about the running processes and other kinds of details, we can find them inside the proc. Next is stem. So what does Temp folder contains? So time has all the temporary files, let's say I'm editing and Word file and I'm not saving it. It will keep on saving all those files in a temporary folder inside them. So when I finally save it, it will be converted into a proper saved file wherever I want to save it. So wherever I will reboot the computer, the stamp files would be erased. Sometimes sometime files might be stuck inside the computer, but mostly they are just erased. Next is usr. So what does USAA has? Usr is used for miscellaneous purposes and can be used by many users. So many users can access it and keep their files. You can have logs, shared files, library files, et cetera, inside of us are. So it is just a use of ice. Next is VA. Vr stands for vasa, Thailand. So if you can have one to have folders, files would be of varying length and we do not know how much data they might have. We will put it in them. Could be some log files, some print files and other kinds of such files. Next is sbin. So what does sbin has, has been stretched for system binaries, similar to the binaries. It has all the binaries related to system files like F desk. So it will list our best details. We have IP config, which will list out the configuration of our Internet and IP, etc. So all these kinds of files are stored in sbin. Next is kernel. Kernel just simply contains all the chondrocytes, so they're just stored over here. Next is media. So nowadays we have a media folder. So nowadays computers can detect what kind of peripheral or a device you're attaching via computer to automatically detected like a floppy disk or a mouse keyboard. So that's why Because the auto detected. So we have this new folder name, media for all those devices. You might find it. 19. 019 Introduction to Terminal : To start working with commands in Linux, we need to first open the terminal. Then we would be working on if it always have the terminal open in front of us. But because it is so we need to first. Okay? So how can I open the terminal? There are various phase and you can open the terminal. On the bottom toolbar. There would be no dominant icon over here. By default. Another thing is by clicking on the button and then you can find the terminal icon of a hill, or here in the search bar, you can search for terminal. Terminal over here. Another way of accessing terminal by right-clicking and then clicking on open. So you can open terminal from any field inside the system. So you are in any directory, you can simply right-click and open the terminal someday. Let's just open domino falls and see what do we see? So when I open the terminal for the first time, this is the screen which IVC. Okay, so let's type in our first command and see. So the first command I'm willing to put in, who am I, WHO AM? And then press enter. It will return the name of the user I have logged in. So I have logged in user that is showing data. So you can create multiple users in Linux as in any other operating system. And you can login with that and check for user, you are logged in. You can just simply do the left one more command. The next command, PWD. I was simply that PWD and placenta. So what PWD does is it shows us the present working directory. That means the folder in which we are currently in. So currently we are in the folder. So it gives the full part where this folder is present. Okay, so next what we're going to do is we're going to use the ls command. What Alice does is it lists all the files and folders which are present in the data. So we are currently in their home directory. So whenever Alice, it should show all the folders and files feature. So here it is showing the x top Documents, Downloads, Music, Pictures, Public, and all the other folders which are half of the hill. So this way we can sort all the folders. Now, what if I wanted to go inside of this folder? What I would use the CD command. So I would just start to CD, change directory and then give space and write the name hostile territory I want to look at. And then press Enter. Then that data would be opened. Pwd home slash, slash. So that is a full part of this shortcut. Whenever we have to tell the whole directory, it is represented by this equivalent sign. So if I have to go to the home directory data, I can simply press, pull and press Enter. And okay, so we will look more into how we can use and other commands into upcoming videos. 20. 020 Linux Directory Commands: So we just looked at the ls command, which lists all the directories and files inside the present on deck. Now let's have a look at some variations of this common. So what we'll see the files inside the folders, which are inside our present working directory. We will use ls space dash. So Let's have a look how it works. I learned ls space dash, capital R plus. So you can see it is listing out all the directories like Desktop Documents, Downloads, Music. And it is also telling me what are the files inside these directories. So it will list out the other directories and files inside each of these subnets, which I'm currently currently I'm in the home folder inside it, we have all these folders and it is also showing device inside of these. So for us. So let's look at another version of LS command, ls space dash. What this command does is it shows us all the hidden files. So the computer has a lot of hidden files, which might be some log files or some history files. So all of those files, which are generally required by the user, but they are being created by the operating system. In the background, we can see all those crisis. Let's look at the synagogue. I already told you that we can use the CD command, which is short for change directory, the goal inside an auto directories. But there are a lot of finishes which we can use the CD command. So if I want to go to the root directory, I will just write cd slash. You'd have to go to my home directory. I will directly CD or I can write cd equivalence. Know, vitally have these two options to go to home directory. What I can do is if I wanted to go to switch my directory to a directory which is inside the home directory. And it is a very low Nim. Have you just write the equivalent sign to denote that it is. So let's use it and see how it works. Currently, I'm at home. I know this because we have this. Whenever we have this equal sign, that means we are currently in the home directory. If I want to check it, I can use PWD to check my present working directory. It will show that I'm inside the home directory of English. Okay. So let's switch to some other directory I wanted to go do. I will just use the CD command. So I don't know any names of the directories. So what I will do, I will just do ls and this will show me all these different directories. So if I were to go to public, I will just strike. And I will write the name of you. And I can just press Tab, and this will just fill the rest of the command for me. So you can use the app button while doing this kind of writing these kinds of commodities is a very good trick that you can use. And let's press Enter. So now I'm inside the public directory. Now, if I want to go to music directory again, I can write the complete bottles of music directory, that is cd slash, home slash slash. And then press Control. And I will be in the directory. But you see a head to write this whole name over here. If I wanted to go to some other directory, let's say I want to go into pictures that are free, again to this cold limb. So rather than doing that, I can just simply do a shortcut that is sitting space. The shortcut for home directory is slash filmmaker one and press Enter. So you can see, instead of writing all of it, home slash, I just give this equal sign. And it illustrated that I want to go inside the home directory. And inside that, I wanted to go to this subdirectory. It just okay. So if I wanted to dedicate, go to mercury, I can or I can use cd. And the disequilibrium, say, Okay. Now let's say I wanted to go to the root directory, whatever Louis city space slash lesson. This week, I will be. Root directory is the directory with all the other directories are present on the computer. Okay. Let's see. What if I want to just come out of this particular folder. If I wanted to do them, seeding daughter, I will get out of this directory. But this is a real directory and directories, so viscerally I cannot come out of it. So I'm still in the root directory. So let me see what are the other directories or him. So you can see these are all the directors of the hill. So let me go into one of these, like the homework. So if I want to move one directory, cd space, dot, dot, and I would be in the home directory. Let's see. I was in the home directory. Now I'm home. All the other users folder. So now I'm back into the home directory of oh gosh, I can Alice and see what are all other directories. Let me go to the music. If I wanted to just most one directory inside of a directory, I need not give the full, but I can simply write cd space and then write the name of the directory I want to move into like music. And then I will be inside them. Let's say I wanted to move out of two directories. I can simply cd space, dot-dot slash, dot-dot Enter. So you see a game out of music. Then I came out of alcohols. Now I'm on Directory. So this way you can run those silica model and you can try different things. Try them out and understand how you can go in and alphabetic trees. It will get a little getting used to. 21. 021 Linux Directory Commands Part 2: Let's continue with the cd command and let's try to open a folder which has a space in his name. So as you can see, I'm backstop, have created a folder named new folder, which has a space in its name. So let's open this by doing CD backstop slash new space for it. So it is saying that too many arguments. Why is it? So whenever you via using CD market trends to read the string. So when it reads, whenever it encompasses, the string is broken. So it is unable to understand that there are two different strings, so it is unable to open that file. So how can we overcome this problem? What we can do is we can do CD decks dog space, that I will use single quotes and write new folder. And so when I write the name of the folder, it will read all of it insight, like it is one string. So it will be able to understand that what I'm trying to see and open, able to open them. So another way of doing that is if I use slash, How do we do that? Let me get out of this folder once again, let us try to go into the new folder inside Dexter cd space next door. So I will write mu, I will get this slash and then write for space. So you can see now also it open the folder. So whenever we give this slash, it will just ignore that the abridging the string and it will just read it as one string and it will be open, able to open the folder. Now, we can move around different folders and we can come out of them and do a lot of things. Now how to create folders using a mildly, let's see. So the command is very simple. Mk space, whatever folder I want to create, I can just create. So I will just name it new folder, new folder. And I will press enter. So a new folder is created and wherever I've got engaged, so I'm currently in the whole folder. Inside whole folder. A new folder is created. New folder. How can I check that? I will just Alice and see what our folders are here. So these are all the existing folders. And you can see the new photo which I created is also listed in this order. Okay. Now we have created a folder. How to delete a folder. So it is very simple. I will just write the name of the folder. Press Enter. So how do I get the confirmation that the new folder has been delivered? Let's list all the folders again. And you can see that from the list of all these folders and new folder is gone. So VR, perfectly. We just saw how we can create folders, how we can remove folders. Now let's see how we can create files. So we will use touch command to create files. I will simply write Dutch name of the file I want to create it. Let's create one. And then it will be upgrading fight. We need to give the extinction of the frame. So I'm creating a text document, so let's be extinct. So my new fight, fight one dot TXT has been created. So let's see if this file has been created. So we'll just Ellis. And you can see all these folders are listed over here. So you can see I can identify which your files as the extension also, and it is also been recorded. So all the files are in different colors and folders or indirect. So animal, they're fine font or dxdy is not existing in this folder. Let's see how I can delete a file. So to remove simply, I will write the name of the fighting. One. Dx dy. So remember, always dealing with files. We have to always use extensions as the rule, but then they are using the graphical user interface. We need not worry about extinctions because most of the time computers take care of those things. So I've removed defense or confirm, I will just list out all the items in this for loop unless. So you can see all the folders are here, but the fight which was created earlier is not listed among these files and folders in this directory. 22. 022 sudo: So let's look at sudo. Sudo is used for superuser do command. What does this command do? So as the use of immediate not have access to a lot of fights, we might not have different kinds of omission to edit or make changes to a particular kind of fight. We can use sudo command and we will have all the privileges switch and administrator has. And it can do anything which we want to do in a computer. So let's say I do not have the permission to update the computer as a normal user. So I can use sudo and then beat the computer and I will be able to update it. As you know, as normal user, I do not have permissions to abate this computer. But as a pseudo user, I can do that. So every day as you do sudo APT update and then press enter, it will ask me for the password as I have set password for anguish, I will just give the password and press Enter and it will start operating the computer. This way, if you want to open a file and make some changes into that, I can use sudo command and then I can write sudo nano and then write the name of the file. And I will be able to open and make changes to that file. Sometimes you might have read-only permissions so you can read a file, but you cannot edit that file. So all these permissions which administrator has given you, you can bypass those by using sudo command, but you might need to enter a password if that has been sent away. Another good way is to not write sudo command each and every time. What I can do is I can login, SO super-useful. So how can I do that? First, I need to set up the pseudo user. How I can setup that is by using the SQL command. And once I have set up using the fescue command, it will ask me for the password 1234. And then what will happen is I would be locked in. So it is saying authentication failed because the password which I entered for the SU was wrong. So let's again try it. So I will try it with the mouse would have said, okay, so now I'm logged in as root. Ok. So now I can do any kind of change I want to do over here. Not all the commands, whichever N2 would be as soon as the superuser. But generally we do not log in as pseudo user and do all the changes because there are some things that you do not want to do as the superuser. So only login as superuser if you really want to do anything which requests those kinds of. One more thing I wanted to tell you is like if you haven't set up a password for ASU, you can set up it oh, first time when you're using the superuser. But another way is you use the sudo command. You can login with ASU using the sudo command also, sudo SU. So now it will ask you for the password of the user you are. So if you have your self-critic this machine and you have set the password for this particular user. So you just need to give that particular password. That is the password you give venue, switch on this computer or this particular machine. So just give that password and you would be logged in as user from this account also. So this is another way of logging into as a superuser. 23. 023 Getting Help: Getting help. So we have started working with bash commands in Linux systems. And we are trying to get familiar with those. But what if we get stuck somewhere? So we can obviously Google, but what if we are working on a solar system? We just remember the command would we do not know exactly how to use it. So what we can do is we can use these commands, like the help command. So what help commands helps us is by telling us how we can use that command V is in which we can do that. In Bash shell. Other than that, we also have man command, which will open the manual pages of that particular command. So we can know a little bit more about the command, how the commodities used, history of that command, who created that command? Lot of extra information which might come in handy while working in the system. So you use the help command. We need to first write the command, which we want to get help on. Let's say we want to get help on ls command. Ls, space, dash, dash, help. And don't. So it will give us all this information. So I can just scroll and see what other information it is giving us. Like it is telling us that we can use these different extinctions like dash r and other things with ls to reverse those files. So you can reverse the order in which the funds are being shown to us. So all those different ways in which this command could be used and how this command helps us is listed over here. So my screen is very full. So let's just try to clear my screen. I will just write clear CALEA. This fill, just clear my screen and I can write my common stock. Okay, now let's see the man command. So how mine common boxes, I will write M N space, and I will write the name of the command, which I want to get help on, that is Alice. And press Enter. So it will open the manual of ls command. Here we have all the information which you might ever need about the ls command, okay, so there is a lot of information or what this command V have information like the author of the command, who created this command. And like reporting bugs and copyright, etc. So all these kinds of information is all here in the manual pages. So what to do if I want to quit the manual page, I will simply press Q and I will be out of the manual page. This way I can get information about any page. Let's do it for one more command like so. You can see I just did the man command with MKDIR and it is giving me information about MKDIR. I will just scroll on the bottom. Again, you can see all the auto bug reporting copyright and all those information. So just try this out. Try this with different commands. Tried to check manual pages, tried to use help command. For most of the bash commands, you will find manual pages of a deal. But if you do not find manual pages over there, you can simply Google and know more about it. One movie is to go to Linux.org. This is a very good site where you will have a lot of information about these things. It is a place where we have forums we can try and them and where we can discuss about all those things. And what else we can do is we can go on to tourists and see the tutorials. I will click on Linux Tutorials, beginner tutorials, or the scroll. And I will just click on one of these tutorials, see what it offers us. So you can see it is telling us how to use a particular command, how to get more information with Linux by using the man command. How we can use it like we can write. Man. I'm good, Yeah, Yeah, and it will tell us more about MKDIR command. So this way, you can get a lot of help by using this website. We have a very good information over here. 24. 024 Printing Contents of Files: So now let's look at how we can see the contents of a file and how we can print something or push data inside a document. So we use cat command to display out all the contents of a file. And we use eco by this command, we can actually print out stuff and we can also push data inside of phi. So we will have a look how we can do that. Currently, I am deck stop. So I will just Alice and see all the contents over him. So I have doc 1 dot txt, which is a text document. So I can just look at what are the contents of it. So what do we do in UI? We just go to the location of the file and we double-click on it. And to fight opens in front of us. So I can read whatever is written inside the file. Like it is saying hello, this file does not have much data. Feel free to add more information over here. I can simply write, okay, and I can just save it. So whenever we have closing a document, it even gives us a warning. Do I want to save it? So I will just save it. But how do we do it using a command line? What I will do is I will use the cat command. So I just simply use the cat command and then I give the file name because I'm inside the directory, I can simply need the filename. Otherwise, I will give the full path of the file. So it is dot one dot TXT. So it is printing out all the information which is inside the file over here. So it has also showing the okay, which we added in the fight. So that's simple, right? So how can we add more data to it? So I will tell you about the eco Hamada. So echo command, if I do equal and write anything, Hi guys and press enter, it will just print out Hi guys over here. So this is how a command just prints out anything which we want to print out. So verity is useful if you're writing some shell scripts and we just wanted to give some print statement. We can use the command. We can use echo command in other manner. Also. That is by putting the data which we are printing inside of fight. So how do I do that? I have it equal and say, I am adding data over here. Then I will give this two greater than signs. And the greater than sign does is it indicates this, this data needs to be pushed inside the file. And I will give the location of the file, which I want this data to be added to. So I've been writing dog 1 dot TXT and press Enter. So it does not. So if that data has gone inside or not, it does not give any error or anything. So how do I know? I just have to print out that document and see. So I will again go to the cat command. So what I will do is ever simply press the up arrow key. So what it does is it remembers all the commands which we have written. So the number of times every press it, it will keep on going to the previous and previous command. So it is another good tip. So you do not need to write all the commands you have already used again and again. So I will just cat duck one dot txt. So here you can see the line which we added over here. I am adding data over here is added to the bottom of our file over here. Okay, Let's go in the UI and see if it is visible in UAE also, because VR much more familiar to the UI interface of things. So you can see my cursor is blinking over a lost, but still I have another line at it on the bottom of this file, similar to Cat, Come on, we have other commands which will help us to print out all the contents of a fight and browse through it. Like the more command. It is very similar to cat command, but how it helps us, if you have a very large document, we can scroll through the pages using the enter key. We can move to next pages using the space bar. We can go to previous pages using and we can also search for strings. Whereas in GET command it just prints out all of in a block. So it is more nicer to have then we can browse through the document, go up and down. So it's four things, et cetera. Again, we have less command. It is very similar to more command, but it has a more visual appeal to it. So it's adjust the height and width of the terminal for the document to be visible pattern. And we can scroll through it using the arrow keys. And we can quit it using the Q button. Let's open one of the documents. So what I'm going to do is more and I have a document, D2. So I will just enter that document using the more command. So you can see here all of the document is visible to us and hear what is happening. Is it it is showing how much of document is visible to me currently on the screen. I have just numbered these lines, so it is easy for us to understand what are the lines. I have numbered the whole of the document, but I have given to some of the lines which we will see in the next section. Okay, to scroll, I just have to use the Enter key. And you can see I can scroll through the document easily. If I directly want to jump to the next page, I will press the space bar. If I wanted to go to the previous page, I will press the button. So if a very big document is still, it is very helpful. If I come out of the document. I just have to just finish reading the document. I will be out of the document. Next is the less command. So I can less the same document. And you can see all of the document is visible to me. It is not showing any percentage, but using the arrow keys, I can just scroll through all of the document. So all of the document will be in the screen and there will be no other things visible for me. While in this view. If I want to get out of this view, I will press the Q button and I will be out of the view of the document. Let's continue and see the head command. Now how had come on books? Had command to print out 10 lines of the fight from the beginning. Similarly, the tail command will print the last 10 lines. And then there is the tag command, which is exactly opposite of Katamari. Let's see how these commands work. So for head command, I will just give head command and write the name of the document. And you see the first stock pen lines of the document are visible to me. So this numbering is actually not in the document. Actually. I have written these things. That is why these numbers are coming. Venue will use the head command. It will not give you any numbering of the lines. What if you wanted to see more lines using the head come head command? You can just mention the number of lines you want to see. Had dash 20. So it will show you the top 20 lines of the document. Similarly, we have the tail command. Here. It reprint the bottom ten lines of a document. If I want to see less or more of lengths, I can just mention that. I can mention if I wanted just to see the 15 lines, it will show me the bottom 15 lines. This way I can use the tail and top commands. One very interesting come on is the cat command. And we can reverse that command and right. And if I do so, what will I get in return is the reverse of the document. All of the document will be printed in front of me in the reverse order. So the last line would be on the top and the first line would be on the bottom. So it's just a nice thing to try out. Just try these commands out and have some fun. 25. 025 Coping, moving, renaming Files: Let's continue and have a look at some more commands, like the copy command and the move command. So if I want to copy a file to some other place, I can use the Copy command. So let me tell you how we can use the Copy command. So we know that we have a dot one dot TXT on our desktop. So I've a CP dot one. I will just ls. So you can see that dark one dot TXT exists in the documents folder. And here you can see that we also have a dog documents file created, which is the new file which we have created. And let's print out this document is fine. So let's just print it. So you can see that I have printed the documents fight over here, and it has all the contents of the Dockerfile. So if I use the so if I use the Copy command, it will copy all the contents of the file and we can copy it to an existing file. Or if there is no file existing with that name, it will create a new file of the mean which we get over there. Okay, so let's now try to see we use the Move command. But Move command does is it will move the five from one directory to the other directory. So here that I was doing the copy command because I did not give any other folders named it created the new file inside this folder only. So while using the morphine, you have to remember this. If we move the five from the same folder to the same folder, there will be no change and we will not be able to observe it if you want to move it. So some new folder, we have to get the location of the new folder. And then I were a doctor. And then I will give the new location, that is documents. And press Enter. Let's go to Documents and save that file exists over them. You can see dark wonder DXC is over here. Let's try to open dot one dot TXT. So you can see the same fight with all the same content has been moved over here. So using the move command, we can also change the name of the file. So how we can do that, I will simply write move, and I do not want to change the directory. I just want the name of the file change from the doc1 to something else. So I will just write dot one dot TXT. And then I will write the new name which I worked for this file to be. I just want it to be d2 dot dxdy. I've represented dope. Let's Alice. So you can see there is no dark one file existing anymore overhead, but d2 exist over here. Let's try to open D2 and see what are the contexts of D2. So you can see all the contents which was in doc, what are over here? That means the name of the dopamine has been changed to D2 just by using the Moon squad. So what we basically did was we copy the contents of doc1 and it got stored in some temporary location. And when we created the new D2 in this same directory, all that data was again copied into D2 and then the dock one was deleted. So this way we move doc1 into the same folder with a new name. And in turn, we were able to change the name of the folder by using the move command. 26. 026 Editor nano: Let's look at editors. So right now we were able to create files, open files, and enter data into the file. So we were able to push data into the files. But we were not able to do lots of things over hill because we were not using editors. It goes give us flexibility. So we can enter data, we can remove data if you can perform certain kinds of operations over there. So in that manner, editors are very, very helpful. So in Linux we have pre-installed editors like narrow band VA. We can install other third party editors also. So let's see how these editors work. First is the nano editor. So it is a very popular data these days. So one good thing is it has a very nice to look at colorful graphical UI. So it is very much modern compared to other editors, which are very plain and do not have much of colors. Still it does not take any mouse inputs and gives very basic informations over there. Next we have the Va. Va is a little bit of advanced editor. So here we have two modes. One is edit mode and police command mode. In edit mode, we can add data, we can remove data using keyboard, as in command mode. We can give different kinds of commands to operate, some kind of operations. Like if you want to search a word, we can use that using the command mode. Okay, So any kind of those advanced features, they feels very often in modern editors that we can perform into command mode. So let's have a look and see how these things work. So currently I'm in my Documents folder and we have a lot of documents over here. Let's open one of these documents. So I will open d2 dot TXT, which we have been editing in the earlier module. So I will open it with Lenovo and a space and press Enter. So you can see using the letter editor, I have opened this file. So you can see I can press using my mouse, but the cursor does not move. The cursor is on the first place itself. So if I want to move the cursor, I would need to use the arrow keys. But simply by moving the up, down or right, Left Arrow keys, I can move the cursor, easy. So if I want to add anything, I will just write it. I'm editing this document. So I can edit anything over here like this. If I want to remove something, habit, just use the backspace and I can removed it over here. So it is very simple to do these operations. And on the bottom, you can see all these shortcuts for different operations. Like if onto, if I want to get help, I will just simply Control key. And it will open up this menu where I have all these options and varied shows. Which button does what? So it is telling me like Control G or F&B display the help text. And Control X or F2 would close the current buffer exit from nano. So it will exit from the editor itself and come into the main terminal. So this way we can read over here and do whatever you want to do. Okay? So let's try to do something else. If I want to write out off a fight, I will simply to control O. And I will write out, if I want to save and exit, what I can do is press Control and X, it will ask me, do I want to save these changes which I have made it? So I would just simply press on y and then press and do. So. At this time, I can change the name of the file also. Okay? If I give some new name, it would be saved as a new fight over them. Okay. So this nano books, we can go inside nano and we can explore other things also over here. If I want to find something in nano, what do I do? I use Control W. W is short for, there is. So if I want to sort something, I will do Control W. So here it will show us a search bar. I can just simply write for anything like file. And then press and took. So it will take the cursor to where the file is written in this file. Okay? So this way you can do all these operations. On the bottom, you will find a key to how to use all these operations. Like if I want to search something, I can use Control W. If I want to cut something, I would do Control K. So this way I can use this operations and learn it. It will take a little bit of time to understand how these editors book, but you'd have to try to use them. Then only if you become familiar with those. The pressures are ready standard. So just read the bottom and try to do these operations. 27. 027 Editor vi: Va is a little bit of an advanced editor over hill. If I want to get into insert mode, I will use the IEEE button. What it means is insert at COSO, okay? If I use it will insert at the end of the customer. Okay, let's see the difference between both of those. So I will use arrow keys to go to the line where I want to insert. So I wanted to insert into this link, I will click on Ibadan and then print num. Okay? So you can see it is inserting where I have the cursor over here. Okay. Let's get out of insert mode. I will press Escape. Now again, I will go to some other place, like every goal at DOE over last word of the ovary. And again, I will get into insert mode using a. Okay? Now what happens is that a typo, it will right after the R. Okay? I can move my cursor backwards using the delete key, I would press Escape. Okay, so whatever I have removed using the deep, all the changes would be done after address the S. Okay? So again, I will get into insert mode and I will type something over here. If I wanted to remove it, I will use the Delete key, but it will not remove all of it. I have just move the cursor using the date key to the New World and I will press on escape. So you will see till the point I have used a date key, all the letters would be removed. After getting into the insert mode. The data which is already in the file, cannot remove it using the sphere. If I want to delete a particular line, I will use WD command, and that line would be removed. Let's go to this link. I will press W, and this line would be removed. Okay? So this way if I want to delete any line, I will go to that light and press WD. So I wanted to go. Okay. I will press W. What if I want to remove multiple lines? What I will do is, let's first go into insert mode and write a few lines, a, B, C, D. Okay? If I want to remove last three lines, I will press three WD. First I have to get out of there is certain I would press Escape and it will get me out of the insert mode. Press three WD. Okay? So this way I can remove multiple lines. If I used to WD, it will remove the two lands, but it will only remove the bottom three lines or bottom two lines. It will not able to above lines. If I want to undo any changes which are made recently, I will use the U button and all those changes would be reverted. But I can only go one change back. Let's write something over him. Any bad Guys? Let's get out of the insert mode and let's try to do shift and capital U. So all the changes which are made to that line would be removed by using the Shift you commander. So this length has been over here already. So I will go in the middle of the slide. I will go into insert mode, and then I will write something, new stuff. Get out of insert mode, go somewhere else, and then again contribute insert mode and add some more later. And then I will get out of things. So kimono, now very good shift capital U. So all the changes, what are made in this session, in this particular line would be removed using the capital you ever simply press Shift and you, all the changes I made to that particular line in this session would be removed. If I want to remove any data, which is in the slide after the COSO, I would use shift capital D. So I will simply press shift and then D, which would be the capital D. And all the data in that line would be a move. So I have removed all the data again, and now let's try to do more changes. Let's do four. So I have removed all the data and I'm doing some more changes. So let's do more things over here. Okay? So I have written some more lines over here. And what I'm going to do is, what if I wanted to go into insert mode now? I don't want any data after this line and I want to get into insert mode. I will simply plus capital C. And I would be, so all the data offer this dollar would be like gone. So if I type something over here, would be. A printed over here if I press Escape. So all the other data in that line would be gone. So ahead, very little data was there. Let's try to do it with something else. And then I will do shift and c. And let's just try to write one letter that is one, and then press Escape. So you can see one is there, although the data of that light has gone. If I wanted to delete a particular number of words, what I can do is I will go into the command mode and then I will write the number of words I want to remove. Let's say I want to lean forward. Let's say I wanted to delete a few words from a particular line. If I wanted to delete two words or three words, what I can do is to delete three words. I will write the number 47 could do 3, D w. So all those three words would be gone. If I want to take 11, I've read one, D for delete and W4 word, one dw. Okay, this way I can read all those words. All those insert and all these commands which you might need to use in the editor, I would be adding in my cheat sheet. So you can see from there and use them as an went to need. But it will require a little bit of practice to walk into an editor like VA, it, it's a little bit advanced editor. Nano is much easier to work with. So there are some other commands also, but I have told you some few basic ones. So if you want to get very good at VA, just try them out, read my cheat sheet, and from there, you can do all of those things. Under this lesson, I'm also attaching a file just for the commands of nano and VA. So just go through it once. If I want to move up and down in the fight, what I can use this KCI will move the cursor up, shake it, and move, move the cursor down. So early computers did not use to have any arrow buttons. So we can use these alphabets to do that. If I wanted to go to the right, I will use a letter. And if I want to move to left, I will use them. If I want to save all the changes which I have made to the file, I will simply, in the command mode, I will write colon and w. This will save all the changes, but keep the file open. Okay? If I want to save and quit, I will write colon W for saving it. And Q4, quitting. This will save all the changes. The fine. If I just want to quit the file without changing ever do colon and q to quit out of the fight without making any changes or any of the change which I might have made during this session. Okay? So these are most of the major things you will encounter by using the VI editor. Although the thing, as it already told you would be in the document attached with this lecture. Please go through it and try out all of those things. Ten only, you will be able to work with VI editor. 28. 028 Search for a file (find,locate): Let's look at some basic utility commands, like the find command and the look in God, what these commands to, let's say I want to search for a particular file in the computer. I will just use F9 Command and right, it's named and I would be able to search for that file. Locate command does the similar thing. But what is the differences? It works in the background. What does that mean is that when the locate command is searching it such as from the database. So we need to keep on updating the database so that locate commands walks up flawlessly. So the locate command is much more faster than Find command, but the only thing is that the database needs to be updated. So by using the fine Thurman, if we want to search in the same directory or VR, we will just use simple dot. And if you want to search it in there from the root directory, so you can see in documents, all these files are there. Let's try to search for one of these files. Find. So when I search for doc1 inside this folder, it easily found that folder. Let's try to do find. When I do it. Dot doc. So you see this time it's searched for the dog and checked in all those places. Now let's try to do find fifth slash docx. So when I do it, it is searching for all the places in this computer. So it'll take a little bit of time and it will tell me where that file might be there. Okay. So it says for all those places and wherever we found doc1, it would have short week, but it just phone doc 1 over hill. So it is just showing me that it is here in this folder. Let's do the same with locate. Come on. So I would just look at for dog bun and it just phoned up one. And here what is happening is it is searching for in the whole of the database. So it is also faster this way. So you can use locate command as well as find them on whichever you may need to use and whatever may be the requirement, you can use those commands. 29. 029 Grep, Comparing Files: Let's see how grep command works. So if I wanted to search for a spring inside a file, what I will use is a grep command. So I will simply write grep dash I, and then I will write the string I want to search for, let say I want to search for a word, let's say C. And then I will write the name of the file that I want to search it. So I'm currently in Documents folder or so I will directly give the name of the file that is the top one. And let's search for it. So it has found for, say, in this line. So the C is highlighted in red and it is in this line, so it is showing the whole of that line. Next is CMP. Cmp is used for comparing the files. So if you wanted to compare two different files, we can use this command. So in my document folder, I have a lot of files. So let's try to compare two files, like compare phi, one with phi. So phi 12 are very similar. That is why it is not returning anything. That's compared to some other files like 51 with 53. So it is telling that file one and 53 before by byte 21, line number 11. So they are different on line number 11. So we do not exactly know what it is trying to say. Let's just print out both of those files and try to understand it. So I have printed both the files, 0, 1, 2. So these were definitely similar. So that is where nothing was returned to us. Let's print file number three. So here you can see all these files are similar, but file number three on the last alphabet, it is different. So that is why line number 11, it told us that it is differing by something. So that is what it was. There are other ways to comparing two files. So the other commodities, the calm COM, and then we pass the names of the two files and then press Enter. So you can see both those files are very similar, so it is just returning this, Let's compare 5123. We know that one alphabet in file number 13 is to frame. So you can see, so all the common things it has listed in a different column and the things which are unique in file number one, it has printed over here and which are unique in file number three, it has printed in a different column. 30. 030 Pipe and sed: So how do we use BY command? If you want to give output of one command as an input to another command, we will use a pipe command. Let's say I'm printing something and I want that output to be given as an input to the next command at the use of Bitcoin. Let's see if with an example. So here what I'm doing is I'm cutting document one. That is, I'm trying to print document one. And what I'm doing is I'm printing first seven lines and I am trying to print the last five lines of that. So if I just do that, this is the output eigenvector. So what if I just did the printing of that file with only had seven lines? It will give me the top seven lines. But because I did the tail 59, so from those seven lines, it got out the five lines and only short middle five lines. So this way we can combine various commands using the pipe command and then get various kinds of output. Set. So SET is just like an editor. But what if we wanted to edit something into the fight, but we do not want it to be edited permanently, but we just wanted something that would be displayed on the screen. So those are the circumstances where we uses. So what we do is we give a command. And then what we do is we pass some parameters, like go some old world and new world by which we wanted to get replaced. So let's say I'm printing hello people. And I wanted the people to be changes, changed by you. So I can just use this command, echo Hello people as city, people replaced by u. Okay? So I'm printing hello People, and I'm replacing the people in this command with you. Let's just print it. So you can say is giving an output of hello, you just have to echo Hello people. It would have printed Hello people. So it was just an example. You would not actually use it like this. But we can print out a file and we can change things inside of that file using this command. 31. 031 Checking File Size: Now let's look at how we can see all the different disk sizes, how much of space each disk is using, or how much of space a particular file is using. So using the df command, it will show the disk space of each of the partitions which we have in the system. And it will show all the partitions in kilobytes. But if you want to see it in megabytes, you can use the df dash M come out also. And using the DU command, what it will do is it will tell us the size of that particular file on the disk that how big that file is. So if I want to check for a particular file, I can space and give the name of that particular file, and it will tell us the size of that particular file. Let's just a df over here. And you can see it is telling me all these partitions which we have, like we have this temp files, we have SDN T2. This is another partition. So it is showing us all the different things and how much of it is in use. Like most used would be this one. C is 43 percent used and also saying is how much is available, how much is used over there? So all of those information at is showing us over here. Now, if we want to see it in megabytes, we will just be f dash m and then press Enter. And now it will give us all the data in megabytes. So it is easier for us to understand. Now let's use the DO command. So I will simply DU and press Enter. Let's see what happens. So what it is doing is it is showing us all the file in this computer. There might be a lot of files, so that might be a little difficult. So what I will do is I will just simply use ls command to see what are the files inside this folder. And I will just pick one of these folders. Let's see, DU, music. So it is telling us music and the size of the music. Okay, let's do something else, like the EU documents. It is telling us the size of the document. So document has more data. That is why it is showing more size over there. So this way you can check out the size of different files and folders using the new command. One more thing you can do is you can LS dash LA edge, and it will balance, although size of all the files inside that particular folder. So all the files which are inside my home folder, it is showing the name and also the size of all of these files. 32. 032 Compress:Decompress: So let's look at how we can zip and unzip files. So if we want to compress a particular kind of file, we can do using these commands. First is a dark amount of tar is a very famous compression tool used in Linux. So you can compress any kind of file using the tar. So it has a very long history. So we have been using it for years in Linux and compress them. Also, we use the darker one so you can use it anytime. So any document which has these extensions like dot-dot-dot, tar.gz, tar.gz do, et cetera, can be uncompressed by using the dark amount. So many times when we download our particular kinds of software, we need to unzip it. You can use the document over there. Next is zip and unzip. If there are zip files, you can unzip them using the unzip command. You can also zip those things using the zip command. So to compress a directory, I need to give dark space. Pradesh said C, F space, name of the compressed file, dot x0, x0 space, the name of the directory I want to be compressed, that is new one. And then I will give the press Enter. So now you can see these or file has been compressed, Let's Alice. So you can see in red color it is telling us a compressed folder is still. Okay. So what I will do is I will just remove don't original folder, new one. So let's try to uncompress tar.gz. So how can we uncompress it? So I will just write Dart and dash CX Vf than the file I want to be compressed so that it's compressed. This and I will just enter. So we have decompressed this file and blood cell and less. So you can see first, because I have already removed the new folder. So when I decompress it, again, the new folder which has been decompressed. So all the compressed files have again come out. So let's open a new folder and see what is inside this new one. So just a CD, new one. So let's Alice. So you can see abc dot TXT is also here. So just before showing you this, I just had a deleted this file in this folder so that when we decompress it, again, these files come back. So this is how you can compress and decompress files. Same thing you can do with the ZIP files. So you can zip files and other files using the zip and unzip command. 33. 033 System Info: Let's look at some system for Saville you name, it will give us the Linux distro which I'm using. So and if I use a dash, it will give me some more information like Connor released aid was an processor type, et cetera. So let's try it out and see what kind of information it gives. You should also try it on your computer and see what your computer tells so to you. So it is simply saying it is a Linux machine and I will to em dash. So it is telling me that it is VirtualBox is the user. And it is telling me the corner version over here. It is giving me the Saturday, May it 256 UDC 2000 and 2001 is telling me the processor type of operating system. It is X86, 64 bit, GNU, Linux. So this is basic information it is giving. If I try it in my Mac, I think they're also, it will give me some information. So let's see humanism. So on my Mac it is telling me to, so Darwin OS. And let's see, what if I give it. So it is telling me, of course, MacBook Pro Local. And it is also telling me there was a kind of ozone wetness. Stay tuned. 2003 the time with right now. And a little bit of other information it is giving me. It is telling me it is X86 64-bit Boise. So all this kind of information you can get using this command. Next is the id command. What does IT command give? It displays the user ID and group of ID of a user. So let's just see it in action. So you can see it is telling me You ID and group ID, SH, groups. So all the information because I do not have created an image groups, so it is not showing those if you would have a group, so it will give information about those things also. So just check it out how the id command box. 34. 034 System Utilities (Date, calander, sleep): Let's continue and see some more commands like the date command. Now, what does date command do? Let's just try it out or just write eight. So it is returning today's date and time. So currently it is 151 am ISD, so it is showing the current date and time. Next is calendar command. Let's see what Ellen, come on, do. I just have to write CAL. We use this command. So what I do CAL, it returns the calendar of the current month and it highlights that today's date over there. So when I'm recording this video, it is 31st of July, so it is highlighting on that particular date. So you can also try it. It will highlight today's date and show the editor of the particular month which you are in. So what we can do is we can do that window and we can do 20, 22. So it will show me the palindrome of that particular year of whichever week type over here. Next is the sleep command, what sleep Kmart stores. So it will hold the terminal by a specified amount of time. So it only takes time in seconds. So let's try this. So how does sleep them on books? Whatever time I give in seconds over hill, for that time, it will hoard the dominant. Let's say I give it 10 seconds. That would be enough to understand it. I'll just press enter. So we just have to wait for 10 seconds until that time. I cannot give any of the commands, so the abdominals hold it. I will just wait for the pen seconds to get oval. So you see time again seconds or over. And now again, I can put any Come on over here. So let's see that by uncommon. So how this command works is if I simply give the time command, it will just not telling me anything, it will just show a 000. But if I combine it with some other compound, it will tell me how much time that command to execute. So let's see. That's two times. And then sleep for five seconds. So it will sleep for five seconds and then it return homeostatic pigment. So it is staying in real. It took five seconds. For this command will get executed. User time was like 0.001 seconds and system time was like negligible. So this is the way this works. So if I give some big Come on, which takes longer time to run, so other parameters will also change. So this way we can know how much a command is taking to execute or to run. If I just keep my computer over hill, use the time command with any other commodity and leave it for execution. And next day, I wanted to know how much time it took, like maybe one hour or two hour to execute that particular task. I can check it using this command. Otherwise, I would not know that long task. How much time? Indeed a definition. Okay. Continuing. Now, next we have is Zack get amount. So how does that get? Come on works. It helps us to display the compressed files. So we have a compressed file in our computer. Let's just try it with that. So I have just as that GET and given the name of the compressed file and see, it is telling me all the data about that. Oh, what is over there? So it is just printing out all those things. Next is mouth amount. How does mount command book? So if you want to mount any kind of external device, let's say an RI or something. It automatically detected. But if we want to change the file system or some other kinds of things of that particular hard, hard disk or drive. We can use the mountain amount. So generally, every different operating system has their own file systems. Sometimes we might need to change it as per their requirement. We can use it. 35. 035 Utility commands (clear exit shutdown): There are some other commands like the exit command. How does this help? It exists from the current shell. So let say I am as a surged into some other machine. And I'm walking over there and I want to exit that particular machine. I just will exit it and then I will be back in my old computer. So this way exit commodities helpful next is clear. So this is a very helpful command. We have already seen it in action, but we need to do is if a lot of data is on the screen and we just want to remove all of it. Just a fresh terminal. Look we want then we can use LEA command. So just erases the visual elements from the screen so that we have a space to write new commands. Otherwise it will keep on scrolling and v would be able to write commands. There is no problem. It says that it just looks better. So let's say we have lot of stuff over hill and they just deal. And see the screen is very much clear. Although things which are happening in background, will it keep on happening? Nothing will be stopped. And how does exit common book? I'll just exit and metal-metal has been exited. So currently I was not into any other shell, but only the shell. I was walking in the terminal, so it has exited. Another good utility command is shutdown command. Similarly, we have restart command and other such commands. So how do we use it? So I will just go in my town middle and just write pseudo shutdown and retrieve shut down my computer. So whenever we do the shutdown, it gives us a window so we can cancel in within that window. Otherwise it will just shut out of a system. So to cancel, we can simply shut down space dash C and it will cancel the shutdown. Otherwise, you can see it is should you look for Grundy 336? That is from the time that I get the command. So let's just wait for it to get shut down. So you see when the time is there, it starts to shut down the computer. 36. 036 uptime,alias: Uptime will give the time since the machine has been up. So if a sample has been running for days or many months, it will just give that out. So let's see, since when my machine has been up. And then we will look at a lice. So added up time. So it is just saying that it has been up for one minute. So I just took a restart this because I just give the shutdown command. So it has been off for just one minute. Let's see alias. So how does alias work? So there could be very long commands and v need to use them very frequently. So what we can do is we can create a shortcut for those commands using the Yes. So I will simply write ALI AS space and then I will give whatever shortcut I want to give. Let's say I wanted to just give see as a shortcut. So how to create alias? So I will simply write a space and then I would give any verb which I want to create a shortcut. Let's say I wanted to create shortcut as C. Then I will c equals two and then I will give single courts. And inside that I've been dragged the name of the command. So let's say I want to create an alias for key ElGamal glue and then having breast, I don't. So it does not give any output, but our alias has been created. So let's see if it works. I will just print c and then Endo. So you can see my screen has been clear just by using those cecum one. So C is short for TNO. If I just give any kind of command is ls or cd dot dot. And I think what I do, and then I just give C, press Enter. Everything would be cleared. So season us. So what I want you to remove some aliases. So what I can do is I can simply use the alias command and right the area shortcut and then just press enter and that ADS would be removed. So let's try to use C again to clear the screen. So you can see it is saying See, Come on not falling. So c is no longer an alias for any command. So I can assign it to some other commands. So you can create your own aliases of all the commands which you use very often, this is a very helpful trick. 37. 037 User Managment: User Management. As a Linux administrator, I might need to add users, change their passwords, create new groups, add users to the group, and perform all these actions. So let's see how these things happen in action. So to add a user, I simply need to write Add User command. And then I need to write the name of the user I want to create. So it is saying only route users can create this. So now you know how and when we need that root permissions. So sometimes by these kinds of admin tasks, we will need a root access. So I will just write the same command with the sudo permission. So it is same user to already exist. If a user already exist, and it will create a new user if I want to assign new user. So I will just create a new user 3. So now it is saying I need to assign a password to this new user. So let's just give it a password. 12341234 is asking for a name. You can just skip it by pressing Enter key, room number, Voc phone, home phone. You can just keep all these things by pressing Enter. Now it is asking me if all the information provided by me is correct, Just give it y plus N2. Now, a new user has been created with the name user three. So a new user has been created with the name user three. Let's try to login from this new user. So I will write it as a dash. You are free. It is asking me for the password. I will give the password. And now I am logged in as the new user three. So the same user three has been logged into this machine. Let's try to change the password of the user. So the command for that is WD. So to change the password of the user and currently lumpiness, I will just need to give this command and I can write the current password. Then it will ask me for the new password. So the same, the password has been updated successfully. Let's say you wanted to change the password of some other useful. So for that, you would need to write the aid of less WT and write the name of the user. You want to change the password, like use of one, press Enter. Again, it is saying I cannot modify the password of this other user because I'm neither a superuser and I may use regular users, so I cannot do that. Let's try the same command with the sudo permission. So now it is asking me for the password of the user three. So I will just give the password of user three. So this way you know that not any ordinary user can change the password of the user. Only authorized root user can change the password of the user. So it is a security measure of the hill. Now let's go and create new groups and add users to the groups. So we could not change the password as user 3 because uses three does not have to root privileges. Now, as I have logged in again to this machine, and as root user, I must be able to change the password of any one person, any of the users of the machine. So admin can do all of those things. So let's try to do that. An ordinary user cannot change the password of the user. That is a security meso we have. But an administrator can do anguish has the rights as an administrator user. So let's try to change the password of some other user using the APA Chicago. So pass WD, useful one. So it is saying I do not have the permission. Why? Because I did not get the pseudo selects sudo and then try this new password. It is directly asking me to assign a password. So you remember last time when you've either locked in as user 3, we will not able to change the user's password. Now it is directly asking us, so let's just give it a password. So passport a period successfully. So a root user can change password of any user on the system. As next is group add. Let's create new groups of the hill. So to create a new group and group my ad, and then write the name of the new group. Press enter. So a new group has been created. Now let's add a user to this new group. So I need to pseudo user space, dash, space, dash capital G space. And it will write the name of the group, which I want to add a user to, that is new group. Then I need to give the username, which I want to add to this group. That would be useful. One plus L2. So user one has been added to the new group. So I have logged in as user one to check if I have been added to the new group. So let's just use the id command and see. So it is telling me my username is user 1 and which groups I'm part of, a part of new group. So we can be part of multiple groups. So if you want to assign single user group or groups, you can do that. And if you want to check that, you can check that in configuration files or you can ID and check for a particular user to all which groups I am part of. And one more thing, if I wanted to check which user I have been your penis, I can always do. Who am I? So I'm logged in as user. To sign in to a particular user. You can use the ASU common. You just have SU, dash and write the username. Then you have to get the bathroom. So let me sign in as user 1. I need to give the password for user one. Now I'm signed in as user one. This way, you can switch to a different use. 38. 038 Changing ownership of file:folder: Let's see how I can check the owner of a particular file to check that. But I can do is I can do ls dash l command. This will year. So all the files and folders inside a folder with these kinds of details, like who is the owner of that file or folder? Who has the different kinds of permissions for that fight. That who has a read permission, who has the right permissions with execution permission. It will also tell the group associated with that file or folder. Okay, so let's understand some basic things. If r is written, that means the read permission. If w is written, that means right permission. If x is written, that means executable permission. If a simple dashes made, that means that there is no permission. So generally, the permissions are written in these order. Read, write, and execution. If a user has all the permissions, it would be written our WX. If the user has only read permission, it will be written as r dash dash. If the user has write-only permission, it will be written as dash. Dash. If the user only has executable permission, it will be written as dash dash x. That means the first places for the read permission. The second place is for the write permission, and the third places for the execution level only permissions. So as I was telling you, only are means read-only. W means write only. X means execute only if it is dashed wx, it means write and execute. R and X means read and execute. R and W means regenerate our WX means all. So these are the places defined. So first places for read, second places for right, and the third places for execution. So in this way, you can identify what are the permissions associated with a particular file. So let's try this command and see what are the permissions for all the users that we will see how we can change the ownership awful fight to some other user. I'll simply do ls dash al, press Enter. And you can see it is showing to me all these folders and different kinds of permissions on them. So first is the texture folder. So you can see over here it is written r, w x. That means the owner has read, write and execution permissions and the group associated with it will have read and execution permissions. And although the users have read and execution permissions, who is the owner of this group? This person, this user is owner of the group. And this is a group associated with this particular file or folder. So the owner of this folder is anguish and the group associated with this folder is ongoing. And the permissions are as follows. These are the permissions of the owner. That means of anguish. These are the permissions of the group associated, that is the uncle SH group. And these are the permissions for all the other people who might want to access this folder. This way we can check for all the other files and documents in this folder. Now let's see how we can change the ownership of a particular file. To change the ownership, we will use the C-H on command. What does this command meet? Chb, change. All means ownership. If you want to change the ownership of a particular fight, we'll do CH, own space, the name of the user we want the, of the ownership of. So if I want to change the ownership of a particular file to user two, I will say CH, own user two, and then I will write the name of the file I want to change the ownership of. So let's see it in action. So currently I'm in Documents folder and you can see all these files are over here. So I have just done the ls dash l command and you can see permissions of different facts. Let's see This File, abc dot pdf. So the owner of this file is anguish and the group associated is also a concussion. So let's try to change the ownership of this file. So I have written pseudo CH, own. Now I will write the name of the user. I want to transfer the ownership to, that is user 1. Then I will give the name of the file. I want to change the ownership off. And then I will give enter. So it is not saying anything. Let's just again do ls dash l command and let's see what it gives. So here you can see that the ownership of the abc dot pdf has changed to, I wish, to user one. Earlier it was anguish, now it is user 1. So this way you can change the ownership of any file using the C-H on command. Now let's try to see how we can change the group associated to a particular file. So here you can see the second command shows how we can use CHO and colon, name of the group and name of the file, and we can change the group of NFL. So I have given CH own column. Now I will give the name of the group, new group. I will give the space and now write the name of the file. So now the ownership must have changed. Let's try two. So now the ownership has changed. And also the group associated with that file has also changed. So using the command CH, own column, the group name, we can change the associated group of a particular file. 39. 039 Changing user permissions: Now let's see how we can add and remove permissions for the owner. So we just saw how we can change the ownership of a fight. Now we are going to see that how we can change the permissions we have given to the owner of a particular file. So if I do CH mod plus r w x filename, this way I can add any kind of permission. The plus sign is for adding the permission. And here I will write the name of any kind of permission I want to give to that. If I want to give all permissions, I will write our WX. If I want to just give execution permissions, I will write plus x. If I went to remove any kind of permission, I can do minus and write the name of the permission I want to remove for the owner of that file. Okay, So all these commands work only for the owner. It is not for groups or the other uses, so that you have to remember. So let us try to change permissions of a file. So let's change the permissions of the user V1. So here's a rent currently only has a read-only access for ABC. Let's change it to something else. Let's say we wanted to give it all the permissions. So I have given pseudo CH mode. I'm adding the permissions for reading, writing, and execution for the fight ABC, pressing Enter. Now it has registered it. Let's try to Alice and see what has happened. So now you can see that for user one, we have given read, write, and execution all the permissions to the use of one. So user one has all the permissions of reading the fight, executing the fight. And you can also see that the OH, group associated with it also has gotten the execution and read permissions. Now let's see how I can remove some permissions for ABC. Okay, Let's do the same command this time what I will do is just instead of I will put the minus sign. Let's ls again. So here you can see all the permissions have been removed. So when the owner himself does not have any permissions, are those also do not have to read or execution permissions. Then user via assigned all the permissions to the owner. Others also get read-only access for most of the files by default. So here you must have seen earlier assigned the read-write and execution permissions. The other users also got reading execution permissions. By default. You can change that if you desire to do so. 40. 040 Changind permissions using num code: So let's see how we can use the numeric code to add or remove permissions. It is much more easier to use the numeric code. So let's go through it. Also. One thing is that we're using the numeric code. We can assign the permissions to the owner, to a group, and also to all the other users we can assign or remove functions. So the court is very simple. 0 means no permission. One means execution to means right. Only three means right, and execution for me is read-only five mins, right? And execution six means read and write permissions. 7 means all the retried and execution permissions. Okay, so let's see how we can use that. We have to simply do CH mod 7, 7, 7 and write the name of the file or the folder. We want to change the permissions to this. We'll give everyone all the permissions. The first digit is for the owner, the second is desert is for the group associated with it. And the third digit is for the, all the other users. That means if I want to give everyone all the permissions, I will use 777. If I want to give all the permissions to the owner, but no permission to anyone else, average 7 000. Okay, this way we can give different permissions to different users and remove permissions as we desire. So simply we have to follow this chart and remember it, it is not most hard. So you just use really have to remember that how to what is no permissions? What is read-only permission? What is read and write permission, what is read and execute permissions. So these are generally given permissions. So you can just remember it in one or two days and try to use it, then you will be much more familiar with it. So let's try to do it in colored light and see how it works. So as you can see, abc dot pdf has no permissions. Let's try to give some uses, some kind of permission. So I'm doing pseudo CH mod and I want to give the owner all the permissions, but others, I don't want to give any permission at all. So I will use 700, 800 and then write the name of the file. I want to get the permissions to and press Enter. Again, I will list out other permissions. So here you can see that the owner has all the permissions and others have no permission at all. Earlier venue, you're not using the numeric system, but what? Giving permission to the owner. Using the simple method of giving the R, W, and X command. At that time, what was happening was when I was giving all the permissions to the user by default, the other users who are getting the read and write permissions. But here using the numeric code, we can have much more grasp over how and what permissions we want to give to each and every user. 41. 041 Networking: Let's look at some network commands. Okay? If I want to know the host name of my computer, I can use the command host name if I wanted to get my IP address or host name. And it will give me my ID of the computer. If I want to ping and see if a particular website is up and running, I can just bring the URL of that website or I can give the IPO of that particular Sobel. And I will be able to know if that silver is working or not. Let's see how it works. Host name, it gives the username of this computer. And if I do it like this host name and dash I, and then I took, it will return me the IP of this machine. So it is 0 virtual network, so it is just giving out that particular IP over him. So what if I wanted to bring a computer and see if it is working? If you have any computer, local computer, you can give its IP and ping it. So being and give like you can give the IPO of your mobile lender to shipping and receiving any kind of data. Or you can give yourself a website, let's say Google.com. So it is pinging google.com and you can see it is continuously pinging and getting some kind of a data from them. You can give IB or URL of any left side of a hill and it will tell you if that felt site is up and running. So if I want to exit, I will just control C and E. So like I have picked Amazon, so over here, you need to get out of it. So if you haven't caught it, you just have to control and C, you will get out of it. If it does not exempt, you can use Control Z, which will forcefully exit and running command. So this is another trick users remember. So what you can do is you can give a different URL of different websites and try this out. One more thing you can do is you can try to get IPO of your mobile and do it. Or you can even create a virtual machine and try to ping that. That would be a fun little excess. Try doing it. Let's look at Host Mark. How does this come on book. What we can do is we can give the weight of any website and it will return to us the ID of that. That's like if I give the IP of any civil, it will return to me the domain of that website. So let's see how it works. I will do host and give domain of any popular website, let's say google.com. Press enter. It will return to me the ID of that website. Similarly, I can do it for some other website also, let's say Amazon.com. So it is returning to me all the IPs of Amazon.com. I can do the reverse average, just host, copy this particular IP and then try to paste it over here. Sn2. So it is saying that it is S3 console dot AWS dot amazon.com, an IP of Amazon.com. So this way you can reverse it also. So if you host any domain, it will give the IP. And if you host any IP, it will tell you the domain of that particular, that's eight or so. 42. 042 Check your IP : How to check your own IP using command line and also how we can change the settings of network. So let's have a look. First we have IF config, and then we have IPA. These both commands work in very similar fashion. If config has been there for a long time and IPA is the new version which has been added. This works similar to the ifconfig command. So using both of these commands, we can check our private IP. And using the current IF config me, we can check our public IP also. So that is a IP which would be visible to everyone else on the Internet. Okay, Let's have a look how we can use those as simply giving. If config, I wouldn't be able to see all my network settings. So here you can see it is showing me my IP, that is 10 dot 0 dot-dot-dot 15, and that is my IP. So you would be able to notice that this IP is not unusual IP. Why? Because generally, when we are on a public network, we get a different kind of IP. But here I'm going to quit work virtual private network. So if you are in a virtual private network, if you are using company intranet or something like that, you will also have IP like this. But currently via my IP is like this. Vibe because I'm using VirtualBox. So VirtualBox automatically assigns these kinds of IPs to all the machines. If you want to bypass that, we can create a British network. Okay, We will have a look at that in a minute. Let's see IBA. So it works in a similar fashion. I will just give IPA press Enter. And here you can see it is also telling me Network Details and my IP is also visible over here. So it also tells me the class of IB and other kinds of materials also. And we use this command. So this is the same IP which I shown using the IF command. So I have config and IPA work in very similar fashion. Now let's see how I can check my private IP. One thing is you can go to Google and search for you. Now let's see how we can check our public IP. One way is you can go to a browser and search for your IP and it will throw you your public IP. And other ways you can do the curl command. So how it works. So you're just simply give current IF config me and give you your public IP. Okay, That was cool. Right? Now. Next we will look at how we can create a bridge network. So one thing you need to do is for that you have to exit the machine. So what you can do is you can just shut down your computer. So I will just say shut down. Then we will do some settings in the VirtualBox menu. 43. 043 Setting up bridged betwork in VirtualBox: Okay, So to change my network from a virtual network to a bridge network, but I will do is, I will go to the instance of which I have created. This is the mint instance. I will click on Settings. Then I will go to network. In that book here I will have options of adapter 234. I will not make any changes in those. I will just click on Attach to. Instead of Nat, I will select bridged adapter. What bridged adapter does is it will create a direct network from my router. And it will give the IB whatever the router assigns to each individual device. So it will also assign individual IP to my virtual machine as if it were a separate device. Rather than creating virtual IP. For this instance, I will have a proper IB, like all my other computers and mobile devices, which I have my host. I will just click on, Okay, and it will save all my settings. Okay, let's again put up this machine and see what happens. So I have booted up in the machine again. Now, let's go to terminal and check over Ib. So my terminal has opened. I do the IF config and it throws me back my Ib. So now you can see it is giving me a normal IP, like they're assigned to any other machine. Okay, let's try to check our public IP. So I will just do occur IF Config not me. So it has returned my ID over here. Okay, so try out and check your IB also. And I will see you in the next video. 44. 044 Firewall: Firewall. With not working, it is very important to understand how firewalls work and the importance of them. These days we are connected to Internet all the time, whether we work in any kind of a field. But when you are a system admin, it is extra important to understand networking and firewall because these are security related things which are very essential as they might be sensitive data and information on our service, which we are running for our company. So let's see how firewall works. Firewall is basically a fall which is constructed in ID so that we can restrict the kind of users that come and connect with the machine and what are the kind of information we give them. So we can restrict the users on the basis of from where they are coming from. So there will be users who would be able to access your websites. Now there would be developers who would be able to give you a code and that would be run on the machine. So your machine excess developers and our DevOps teams, they will have, whereas users will have access to the service as a user. So all those things need to be configured. So let's have a basic understanding of firewall in this lecture. Now let's look at very basic commands that are enabling and disabling firewall. That is u fw enabled by this command, you can enable firewall in your computer. Most of the times it is already enabled. Then we would look at how we can check the status of firewall. And it will also give us a list of all the open ports on our computer. What a ports. Ports are the places where we can make different kinds of infrastructure. Let's say we want to have an FTP protocol where you can browse for files. So for that we will open a port in our computer, then only it should be able to transfer and receive files. If that is disabled, we will not be able to do so. That is a security MSM. So only then we need, we will open a border. Let's say we want to allow people to access website which is hosted on my computer. I will give them HTTP access. Okay, We can open perfect for everyone using the allow HTTP command. What that will do is everyone, My IP will be able to access my machine. But that is not a good idea. Mostly if you are having a cough Salvo, always use a DNS name. You need to configure it, then your IP will not be visible to the user. Only your DNS name will be visible and they will be able to access your website. Next thing is that you can deny certain kinds of users. You know, that certain IP is just to try and do fresh you solver again and again, bringing to your system, you can specifically restricts some particular IDs. So that is how you can do that. Other things which we can do using this, we can allow certain, particular IP is to be able to access the machine. Let say we will give SSH access, which will give the access to my computer from someone who is sitting remotely and they will be able to access my computer and give any kind of commodity. Generally, we have all our infrastructure on Cloud and via SSH into machine and then only Volk on the machine. So we'll have a look into that in the future lectures. But right now we will just see how we can allow and restricts certain uses. First-time, starting with pseudo, you have to do status. This will tell us the status of firewall ANOVA system. So it is saying status is inactive. So currently fireable is not active on my computer. So what I can do is sudo, if you have to enable firewall is active and enabled on your system. So now the firewall has been activated on my system just by using this command. Okay, so what next? Let's try to look at the status once again. So you're saying firewall is active. So firewall is active and currently no extra ports are open on the system other than which are necessary ones. So let's try to open one of the ports and see how we can do that. Let's give access to extra ATP. So HTTP is generally used to give access to any kind of hypertext 0 webpages which we can host in our computer. And then anyone would be able to access those using my computer's Ib. So that's just enable that port. So HTTP, you have w allow, HTTP will allow any kind of HTTP access to this computer. So rule has been added. So let's again do HTTP status. And you see now when I do the status, it is saying that port 80, which is a default port for HTTP, has been enabled on my computer. Similarly, I can allow other ports also. Let's allow SSH. So allowing SSH, what it does is it will open port 22, which is the default port for remote protocol, which allows you to login to shell. So these are the rules which have been added and aptitude. Now let us see how we can deny a particular kind of a port which has already been eliminated. We can disable any port by using the command. So I would like to suitably of w as a set. So the same rule updated. Now, let's again list out all the rules. So it is saying that firewall is active and you can see that port 22 is denied right over here, but it is showing over here in the list. So we can get a very big list over here. And what if we just want to remove all the denied things? We just don't want anything which is not allowed to be visible in this list. We can remove them also. So how we can remove them is by using the delete command. You can just delete any kind of rule which you do not want it. So let's just try that. So let's say I want you to believe in I, SO such rules so that all those rails do not come in the list. I will just simply write pseudo year of w, elite, SSH, press Enter. So it's saying the rule has been updated. So you can see that we have only the PCP rules, which are for HTTP. And all the other 22 ports have been removed. To reset the firewall do its default state, we will use sudo Jacobi reset command. It will ask me if we want to really do that. I will just say yes. So it will update all of the rules and it will take it to the initial status. So you can see when I do the u fw status now it is saying it is inactive. So it is again disabled as it was initially. We can do a lot of advanced thing using the firewall command. What we can do is like if I want to enable a particular board, but I do not want it to be enabled for a particular ILP. What I can do is I can say pseudo, you have to deny or PCP from this particular IP. I want you to be denied from to any port 22. What does that mean is that my port 22, if I have enabled, it, will be enabled and I can SSH into my computer. But for this particular IP, it will not be enabled. So in this manner, we can do various kinds of advanced things. We can allow profit from particular kinds of IP. We can denied from particular kinds of IP. We can also do where it is enabled for everyone except a few IPs. 45. 045 Memory: Let's see some memory-related commands, like the free command. How do we use this command? If I want to check how much memory is free in my system, I can use this command. I will simply write free in my terminal, press Enter, and it will show me all the memory which is free in my computer. So I have eight GB of RAM, so I had a lot of RAM. That's why I've given it more RAM over hill. And it is just showing me how much of it is free, like more than 60 be nearly seven GB of RAM is free. I'm using very less of RAM. One more thing what you can do is you can free and then dash m. So it will show you RAM in megabytes so it is easier for us to understand. So it is saying that it is like totally, I have like eight GB of RAM and 6.5 Gb of it is free and uses like what, 633 megabytes. So you can check it in GB also. So it is a strongly to the lower number. So I have just like more than seven GB of RAM, but it is just running it off. And I have like more than 60 boyfriend 3. So because it is ripening off, so you can see 633 and B of RAM is used. But when I'm rounding it off to gigabytes, is rolling off to the lower number. That is really saying using any memory, which is not possible. So just be careful about that. So another useful Come on is the VM stack. So it is view memory statistics. So let's try to see this command and see what are the kinds of statistics we are able to see with it. So when I do via stat, it gives me the information in a tabular fashion. So it is telling me about the memory. So how much is free? Hamas is buffalo homozygous cash. Hamas is swap. So all those information it is displaying to me. One more thing I can do is Vm stat dash S. And it will give me the list of this is how the memory has been used in a linear fashion. So I can understand about all the kind of like paged pages and all the other kinds of things which are listings of swap pages in, swap pages out all of the details where the memory is being used, how it is being used. I can get over here. 46. 046 Process (ps and top): So computer runs a lot of processes and background and foreground a lot of processes. We might be running like a player or video player, browser, editors, lots of things we might be doing in the computer at a time. So all of those processes, if I wanted to see what are running, what are not running, I can use these commands. So similar to the memory commands, they also give an abelian representation of all the information. So first is a ps command. If you give out information about all the processes which are running on the system. So I simply BS and it will show me all the processes which I have started using the terminal. If I wanted to look at the background processes also, I can use the ps dash E. Then we have the dopamine. So the basic differences that top gives real-time view, whereas ps gives a view as in a snapshot. Whenever we give the PS command at that time, it takes a snapshot and tells us about all the information as of that time. And top command gives a life data chart to us. First, I will just simply do ps. So you can see it is telling me what are the BS processes being run. One is the bash and secondly is the PS command which I just ran over here. So these are the processes which I have created using the terminal. But what are the background processes? If I wanted to have a look at that, what I can do is I can do ps dash d. Okay, so here you can see it is giving a list of all the processes running in foreground and background. So if I want some more detail of these things, what I can do is BSE f. So it will give more detail about all of those processes. So it is giving me more details like the UID and GID. So you can use a ps dash ef to get more details like this. Let's have a look at the top command. So if I do the top and press Enter. So you can see I'm getting a tabular representation of all the processes. Here it is giving me the process ID usable and all such details. And also this data is keep on getting updated with time because it is real time beta. One more thing what I can do is if I'm running any process, I can just get its own PID. And using that PID, I can stop a process. I can kill a process and do other things. 47. 047 Killing a Process: Continuing with processes, Let's look at how we can kill a process. Let's first understand what a scaling a process mean. So if a program is being processed in the computer, that mean it is in running state, we can stop that. Let's say we are playing a video and we want to stop that video from bling, we can use the kill command. V and V are in UI, we can directly use the close it. But when we are in command line, there might be some processes we are unable to close otherwise, and we might need to use the kill command to stop that process from happening. You can kill any kind of program using the kill command. So we can offer something using the UI and Dan stop it using the terminal using Kikkoman. So to do that, what we need is the process ID of that process. So how can we grab the process ID? We can simply ps all the programs which are running in the computer and then grab the process ID and then kill their program. We can use the top comma and then there we can search for a process and directly kill it from there also, we will look at both of those phase. So let's first ps, all the programs which are running on the computer, then I simply do ps. So only two programs. It will show that I've started that is a batch, batch, which is this terminal. And second is the PS command which I just tried. So these have already executed. So if I want to get a list of all the other programs, I can do the PS II commands. But I want to see a visual impact that if a process is getting killed or not. For that, what I'm going to do is I will simply open a browser window so that it is easier for you to understand how killed them on books. I will just make the window smaller. So you can see that this browser is running on this one side. And what I will do is I will just simply do the ps dash d command. And we'll list out all the processes which are running in this computer right now. Okay, so let's find where we have this browser. So here it is saying the Firefox. So the process ID of Firefox is 75, 92. So I will simply do the sudo kill. And then I will give the process ID 7, 5, 9 to press Enter. You can see it has got killed and from this site the browser has stopped. It has just gone. Another one way is that if there is a very long list of processes which are running in the computer and we are unable to find fear that particular Firefox program is, I'm unable to get the PID of that process. So to easily get the process ID of a program, what I can do is ps dash E, then I can use the crab and then write the name of the process. And it will show me the PID of that process. So I have written PS dash E that I have given the grep command. And inside the quotes, I'm going to give the name of the process I want to search for. Let's say it is. So now it has just returned the von PID of the programs which I have such for using the grep command. So it is not showing the whole list. So I can simply get the process ID over here. Otherwise, if I would have simply given the PS command, what would have happened is that it would have given me this whole long list. So just by giving the ps dash E, GREP Firefox, what I get is only the process ID of the Firefox program which is running. So it is easier for me to kill this program. Let's do. So what I will do is and then I will kill this program using this processivity that is 7, 9, 17, press enter. I just gave the wrong process ID. So now you can see that this process has been carried. So as I told you, another way is that we can use the top command and then kill the processes. So let's see how we can give them using the top command. So we have this Firefox program running over here. And let's what do. We will use the drop command and list out all the programs which are running. So what I will do is I will scroll and see the, the particular Firefox program might be and get the PID of that program. So as you can see, this is a very long list of all the process of programs which are running. So I have found where the Firefox is running. It is running on, PID it to 46, how I can kill it. I have a simply press the Kikkoman. Now, I will give the PID of the process. I want to kill it to 46. So first I pressed key, and then this bar came over here. In this bar, I give the process ID of the process I wanted to kill. Then I will press enter. It will just confirm, and then I will again press Enter. And then you can see the Firefox program has just exited. 48. 048 Writing and running code using terminal: Let's see how we can write a program and then run it using the command line. So as a DevOps engineer or as a system administrator, you might need to push codes now and then, and for that, you need to know how to do that. It is very simple. So it is just like writing a chord in a normal computer. So we will first create a C program, then we will compile it using this simple GCC command. Then we will run it using those simple a dot out command. So let's see how we can do it. One thing you need to remember it. So C is already recognized language over here, so there is no problem. But you might need to install some lib C dot-dot-dot TBL libraries. So these libraries might be required to run some programs. So if that is the case, please do so. Another thing, if you do not know how to write a program in C, do not worry, I have attached to simplify with this lesson, just copy paste it. And this simple program will run. If you do know how to write a program in C, you can write any program of your choice. I'm just writing a simple program of adding two numbers. You can write a program of helloworld. It is very simple. You just have to print a statement. You do whatever you want to do. First, let's create a file. So what I'm going to do is I'm going to touch and create a file. Remember, while creating the file, we have to create it with the extension dot c. Then only it will be able to recognize that it is a C file and it needs to compile it. So I'm just naming it. Hello. Dot c, just created the file. Now you can edit it in any kind of editor of your choice. Okay? So I will simply so I'm just using the lender editor. You can use nano or VA, whatever editor you like. I will undo. So now I'm inside this file. So you have to just write a simple program. You know how to write the code. You can write it. Or you can, what you can do is you can simply copy paste the code which I have already written. It is attached, fit this lesson so you can just copy the contents of that file and then just paste it. So in earlier modules, I have already told you how you can cause copy-paste from host machine to the guest machine and from guest to host. If you have enabled it, you should be easily able to do it in a virtual machine while using your normal browser of your computer also. Now next I'm going to save this file. I will just press on the Control X, save it. Now the file has been saved. What is the next step? We need to compile it, how we can compile it. I just have to give GCC, then give space and write the name of the program. Hello dot c. Next, I need to compile it so I will simply gcc then give the name of the file hello.py and then present 0. So it is giving an error, maybe because the modules for the libraries is not installed, so I will simply install them. So the command is sudo APT. First I will update the computer. This will just take a few seconds or a few minutes. Just wait for it to finish. When it is done. What next you need to do is sudo APT. So it is installing the library C6 packages, which are the developer packages. So the installation is complete. So let's now again tried to do the GCC hello dot c. So it has compiled the program. Now I simply need to do dot slash a dot out and then press Enter. So the program is to add two numbers. It is asking me helloworld, enter an integer. I will simply write 20. Enter in digital. So it is asking me to enter another integer and we'll get ten. It is saying 10 plus 20 plus 10 equals to 30. So it is doing the simple mathematical sandwich I want you to do. So do try it out how you can create a program and then run it using the terminal. 49. 049 Installing Apache server: As the system at when we will need to take care of all our servers, which we have over there. On the servers we can have different things. Like we can have a company data, we can have databases, and we can also five applications, user applications, the applications, different kinds of things. So in this lecture, what we are going to do is we are going to create an install our own Apache to civil and overdose. We are going to have a web application deployed, a very simple application. We will just deploy a Hello World page and see if it works. So simply, first what we're going to do is update and install Apache two. Then we will see if the Apache two is up and running using the system CTL command. And also we will hit that IB in our browser to see if that is up and running. So let's first a bit of a computer. So so whenever we are installing something fresh, always update your computer first. So all the packages should be up to date. Then only we will install any software. Next is sudo APT install a patch into. So it will ask me for my permission. I will get run. Yes. And then it will start installing a budget to solo. It will not take much long. If you have a slower Internet, it might take a little bit longer as well. It will just take a couple of minutes to install a budget to civil. So our Apache server is up and running. So how we can check that is, one thing is we can use the system CTL command to check the status. So the command is sudo system CTL status. So I will simply get pseudo system CTL status, Apache two. And so it is saying that a budget to silver is active up and running. So if I want to exit this, so it is telling me in real time, so if I were to exit it, I will just simply say control and then C, and I will be out of this. So another way is that I can hit my IP in my browser and see if it is up and running. So how can I check my IP? I will just simply do IP. And it will give me my IP. So my IP currently is 192 168, 29199. I can simply just copy my IP, go to my browser and paste it over there. So my browser has come. I will just give the IB and dope. And you can see that the default Apache two homepage has come in front of us and we can simply see to it. So the other things we can do using the system CTL command R, we can restart our system, we can stop our system and we can start off the system. So it is very simple. We just have to system CTL and then write what we want to do with our so on. Let's try to stop over civil. So to stop over, so I just have to give pseudo system CTL stop Apache two, then press Enter. It has stopped by Apache to several. So let's see the status of our budget to server. So when I do the status command, so Apache two, so is there, but it is currently inactive. It is saying it is currently inactive or debt. So let's see what happens when I refresh this space in the browser. So when I refresh the page has gone because of a says hello is currently inactive. So let's try to start it again. So to start it first I will exit this. And then I will again give the system, start them on. Pseudo system CTL start Apache 2. So now my system must be up and running and we'll just check the status. So you can see it is active and running. It is saying active running. So let's go in the browser and refresh it again. So you can see the Betas come back up. One more thing we can do is we can restart the server. So what, how does it help if we have made any kind of an update to the silver? So wherever a new webpage or some new code has been added to the code, I will simply restarted and within just a second it will be back. So how to do that? I will just have to give restart. So how to do that? I will simply do sudo system CTL, restart Apache to press Enter, and it will be restarted. Okay, so whatever new court we have pushed will be there available for everyone offer restarting the civil 50. 050 Uploading your webpage to server: So we have installed our Apache server. We have also seen how we can start it, restarted, stop it, and how we can access it using the browser with our IP. When we host actual application, we always have a DNS name and we always update it with the DNS name. It is not secure to directly use user IP, but by testing and running on local machine, you can just use your IB. Never go to a live site with an IP. So that is a basic fact. But now what we're going to do is we're going to change the default page from the Apache default pitch to our own default page. So what I'm going to do is let's go to the machine and C. So this is a budget to landing page which we are seeing over here. This website is also saying that we can go and replace this file inside VR WWW slash HTML slash index.html. We can replace it with our own page. Okay, So how we do that? We go to terminal. I change directory, so I CD, then I write the name of the directory I want to go. It is slash slash, slash WWW slash, ML, slash and down. So this is M. I'm going to Alice. And here we have the index.html page. I'm just going to remove this pitch and put my own page over here. I will just after, just remove the default page and I'm going to create a new page. So I will dispatch index.html and two. So it is saying permission denied. I will simply do sudo. I will be able to create the page. Just so I have entered into the document here. I'm going to write my own code. So this code I'm providing to you, if you know how to write your HTML code, you can just write your own webpage. Otherwise you can use Michael. It is a very basic code. You can just do HTML and right inside of it, like Hello world, that will also work. You can copy my court also. Everything is fine. You just need not worry about anything. You can go to web and copy some other website cord. Also, it is very simple. So I'm just simply going to paste the code I have written. So this is a little bit of Courbet I have written. So I'm just going to save this. Now. I'm going to start the system. So I'm just going to restart Apache to solo per cento. So my Apache to server has restarted. Let's go to the browser, refresh the page. So this is the page I have created. Welcome to my page and just a testing landing page. Enjoy your stay over here. Okay. So it is asking, what do I want to select the whole he'll choose your favorite color so it just can select any of these. Connor, I think my code is little bit breaking and it will check it and fix it in. This lecture should not be here. So this is the final page which we have created. You can refresh it. You can select these things. We have just created some bullet points you can submit, and you can do whatever you want to create your own page, create your own styles, try it out. You can do a lot of things, a lot of fun with creating your own websites and your own webpages. 51. 051 Shell Scripting: Shell scripting. So what a shell scripting, but we have to run a lot of commands in a sequential manner. We write skips for it. How do scripts walk? So v write them with the extension dot SH. By this, the computer knows that it is a script file. So the script is nothing but a sequence of commands which will execute one after the other. So if you want a particular task where we need to write ten commands and we want to do it every day. If such task is there, we will create a script for such tasks. We can also schedule the scripts to be run at a particular time in a civil. So it is a very helpful tool to use shell scripts. So how do we write a shell script? We just create a file with the extension.message. Then the next thing is whenever we write the file in the beginning, we write hash exclamation mark slash pink slash SH. This tells us that it is a shebang file. So hash symbol means the sheep and the exclamation mark means the band. So it is the shebang file which is being created. So the computer knows it is a shell script. Okay, so what is the next thing we need to know? So first we will create a file. We can name the file anything and we, we have to give the extension.me. And then starting the script, we have to give the shebang symbol, and then we have to start writing. Is always good to write comments in your files, such as we do in the programming. Similarly here also, it is very good to put comments while writing. So to give a comment, you can simply use the hashtag and write any kind of comment over there. Okay, so let's first write one script and then executed. So to write a script, as we create any regular fight, we have to just create 15. I will just name it test. So our file name test has been created. Now we will open the test file and edit it. So the fight has opened. Now, I will just write a simple script. So if you want to write, you can write any kind of script. You can just give a simple single line command also. But it is always nicer if you have 23 commands over him. So what we can do is we can just equal one or two things. Or what you can do is, I have attached a file for this lesson. You just can copy paste that script and you will be able to run a simple shell script. So the first line we have to write hash bang, bin bash, so that we have written after that you can comment anything, whatever you want. So I am giving to you 15, which you can just simply copy and paste. So you can also copy paste this file which I am copy pasting it. So very simple. So you can also copy paste this simple script which I'm using over here. I'm first doing this line with what is your name. Then I am asking you to read in perform the user. So it is restoring that input in person variable. Then I'm printing hello, and then I'm printing the variable. So if you want to take any input, you can use the read and print any thing which you have taken as a variable. You can print it using the dollar symbol. So it is a very simple script. I will just simply save it. Now let's make the file executable. So how can we make the file executable? So we will just use the CH mod command, change mode plus x. That is, we will add the executable permissions to the test.js edge. So we have learned in the previous modules that how we can convert any file into executable file. And we're going to convert it into executable file and then run it. So I have written CH4 plus x desktop message, then I will press enter. So now this file has been created as an executable file. Now let's just run the file. So how I can run it as just have to give dot slash desktop as such and then end up. So it is asking me what is my name? I will just give an Kush, press enter. So it is saying, hello gosh. It was a very simple script. You can write other kinds of script old. Let's try to write one more script and see how we can write these kinds of script. So I will name this one new message. So I'm creating a new file named newdata message. So I will just write the basic, uh, she bashed line and then write down my script. I can write any kinds of commands over let say. And then present working directory, something like that. I will save this. Now let's try to run this. So first ever need to change it small. So the thing, the permission is not there, so I will try to do it with sudo. So I've converted it into an executable file. Now let's just execute it. So you can see it is just listing out all these files over here in the first line. And the second line, it is just a running the other command which was off the present working directory. So this way, you can have multiple commands added into one file. So let's open the file again. And I have added some more commands of hair here, like the date command, ls, l command, and then ps ef command. So have added more commands. Let's see if this works. We'll save it. Now let's try to run it. So before running, let's create it as an executable file belts again, now I'm running the file. You can see it is showing this on data. Let's scroll up and see if it did all the operations we have written. So first was the ls command, so it has a list or don't all the folders were told their than the present working directory, the home directory of vanquish. Then it is telling today's date and time. Then it is telling details of using the ls. L, come on. Men. Last, we have the bs command output also over here. So you also try writing some scripts and run them. So you can do any kind of task over here. You can declare variables, add them, and all those kinds of things. Also using the scripting.