YTread Logo
YTread Logo

Linux Operating System - Crash Course for Beginners

Jul 01, 2024
Learn the basics of using Linux. Josh teaches this

course

for absolute

beginners

and will help you fully understand how the Linux

operating

system

works. Hello everyone, my name is Josh, Tech Support and welcome to my introductory Linux

course

. The purpose of this course is to help you get a complete overview of what the Linux

operating

system

is and how it is used in everyday life. I realized that there was a need for a basic course for people interested in learning how it feels now that Linux is used in virtually every aspect of the field, for example, Linux is used in the cloud, it is also used in the field of cybersecurity, especially when it comes to pin testing, so I created this course so you can at least get the basics of using the Linux operating system now. a quick disclaimer if you are looking for a more advanced course for say a

linux

certification then this may have information that can help you but it will not cover all the topics needed to pass a certification exam and just to give you an overview , I will only cover basic topics such as installation, basic configuration, using the terminal, understanding the file system, and software administration, so remember that this course is designed for people who are very new to the Linux operating system.
linux operating system   crash course for beginners
I have a course that hasn't done it yet. It has been fully completed and will be released in the near future and will cover all the modules required for the Comptia Linux Plus exam, so once loaded you can easily move from this course to the next to take the Comptia Linux Plus exam now. Let's start by telling you a little about me. I have been an IT professional since 2007. I have worked in various positions some of which as network administrator, system administrator and currently I am working as a database administrator and I have also been a Linux user since the year 2008, so I have a lot of knowledge about how to work with Linux operating system.
linux operating system   crash course for beginners

More Interesting Facts About,

linux operating system crash course for beginners...

Now, what is Linux? When most people ask this question, the answer given is simply Debian Ubuntu Red Hat or maybe Arch Linux, but these are what are called Linux distributions and Linux is basically the core of those Linux distributions combined with other software such as GNU software and other preinstalled software. Now just to break down everything that comes together to create a distribution we have to look at some of the creators of each port separately and the first one I need to cover is Richard Stallman and in the 80's many companies were still developing their own Unix operating system, for example, IBM Sun and HP all had different versions of the Unix operating system they were developing. and the results were a mass of Unix dialects and a dozen different ways of doing the same thing and this is where Richard Stallman stepped in to end the era of eunuch separation and prevent people from reinventing will by starting the GNU project and GNU simply. means that gnu is not Unix and its goal was to create an operating system that was freely available to everyone and where everyone could work together and many of the command line tools found in Linux today use the new tools that were created under this organization by Richard Stallman and just to give you a little bit more about his background, he is an activist of the American free software movement, also a programmer who went to MIT and also created the organization called the Free Software Foundation and is an avid activist so that the software is distributed in such a way that its users receive the freedom to use, study, distribute and modify that software, so now this moves directly to the next question, which is what is the Linux kernel and the Linux kernel is a free and open source monolithic module that operates Unix-like multitasking. system kernel and the kernel is simply a program that talks directly to the hardware and manages the resources and processes and the meaning behind

linux

is that linux is not unix and to cover the creator lin, the linux kernel was actually created by a guy called linus torvalz and after its creation, it was soon adopted as the kernel for the gnu operating system and became a free replacement for unix and since that combination of these two projects it has spawned a lot of operating system distributions and almost all of them are commonly called Linux now that we understand the GNU project as well as the Linux kernel, let's go and cover a Linux distribution.
linux operating system   crash course for beginners
Now there are many Linux distributions, but in a nutshell, a Linux distribution is a complete Linux system package and many Linux distributions are available to me. any computing requirements you may have and most distros are customized for a specific user group such as a business user, multimedia enthusiasts, software developers and an average home user and as you can see on the screen these are the four main linux distros out there one is ubuntu debian and then kali linux as well as red hat and just to explain each of them ubuntu and debian or one of your basic linux desktop distros that you can use and we all know that ubuntu It is the most popular distribution in the world and I threw Cali Linux up there because this is the most used distribution when it comes to cybersecurity as well as hacker culture and red hat covers the business side because this distribution is not one hundred percent free and the The way they charge in terms of the model for Red Hat is that companies pay for support, but as stated, there are plenty of Linux distributions that will meet most of your needs and now let's cover the course distribution, which is the distribution that I will use throughout this course, which is Ubuntu and us.
linux operating system   crash course for beginners
Know that it is based on Debian and is mainly made up of free and open source software and that Ubuntu is released in three different editions. They have a desktop edition, a server edition and a main edition which is usually used for Internet of Things devices as well as robots and all editions can run only on the computer or in a virtual machine, that's why I chose ubuntu for this course because I want you guys to continue regardless of what hardware you're working with right now, let's go down and get started now. As I said in the previous segment, we will be using Ubuntu throughout the course, so now I will cover how to download it and install the distribution.
I am currently on ubuntu.org, this is the easiest way to get the ubuntu distribution. If you hover over to the top where it says downloads click on the down arrow it will take you to the Ubuntu desktop and the current version right now is 20.04 and I always recommend people to use lts which means support In the long run, this version has the longest. support time vs any of the others now you can also install the ubuntu server version but it doesn't have a desktop environment and as I said before there is a ubuntu core or ubuntu for iot that you can download for your mini boards like a raspberry pi now to download it all what you have to do is click on 20.04 and that will start the download and it only takes a couple of minutes depending on your internet speed, but you want to go down and download this and then I'll come back once it's done to do the installation with you , so now that we've downloaded Ubuntu, I just wanted to talk about the two ways you can install Ubuntu.
Now there is a direct way and there is also a way to install it virtually. machine and you can also install it within the cloud, but most of the time people install the cloud server edition because they might want to set up a web server or something like that, now you can install it directly on your hard drive, but I definitely don't recommend doing this for this course unless you have a secondary computer because when you install it directly on your system you need to make sure you have a backup of all your files and since we're just doing a course.
In a simple intro, I don't want people to go through this and ruin their computer by not having backups, losing files and not having a way to recover them and then when it comes to a direct install you have to write the iso to a USB or a CD, which will cause a little more confusion than necessary just to go ahead and run a couple of commands that I'm going to teach you throughout this course, so the main way I want to show you how to install ubuntu is by using an application called virtualbox now Oracle virtualbox is a type 2 hypervisor and also the virtual appliance can be installed on the three main platforms: microsoft windows mac os and linux and then also when you use virtualbox you have the opportunity to try the OS. before you commit to installing it directly on your hardware and then also one thing about virtualbox, you should have newer hardware because the newer the hardware, the more likely it is that virtualization will be supported through your processor and since we're on 2022, I know a lot of people are using newer laptops and virtualization is on by default and I wanted to make sure I opened this up to as many people as possible so they can complete the training successfully.
Now, let's jump over to my desktop so we can go through the installation. ubuntu inside virtualbox, okay so our iso is downloaded and I have it stored in a folder, but this is what I actually downloaded here, which is what you will receive when you press the ubuntu download button, so you want to make sure you find that location. so you can create the virtual machine now, this is virtualbox manager and it is a very simple application to use, it looks and feels exactly the same on all the different platforms, so Windows, Mac OS and Linux look pretty much the same and most likely when you first open this app there will be nothing there and currently I have some virtual machines here so they are in the list now to create our virtual machine all you have to do is press new so we can press new and then what you want to do is name the operating system.
Now I know this is an Ubuntu system so I'll just put ubuntu as the name and you can also put the version number. Sometimes I put 20.04 at the end and do that for the purposes of this video so you can follow along now you want to select the type now it will automatically recognize based on what you type here and it will automatically show ubuntu down here as well as the type is Linux and if we click here I just want to show you the different options, but you have Microsoft Windows Solaris Bsd IBM Mac OS X and others and what you want to do is make sure that you select Linux most of the time.
Like I said, when you type the operating system, it will automatically update here with the correct information and you want 64 bit, as you can see when you click under type, it will open and expand the different versions and what you want. What you need to do is make sure that's when you've reached 64 bits, so we're good, we can hit next and now this is your memory size. This all depends on the additional resources you have on your system. Now my laptop has 16 gigabytes of memory so I have some to spare and for this demo I'm just going to select eight since I have resources to spare, but you might want to select four or six when it comes to this depending on how much memory you have.
Now the Ubuntu system can run with less memory depending on the desktop environment, like for example if you are using the xfce version of Ubuntu then you can probably get away with two gigabytes of memory, but I always recommend people starting out to just give it up. four gigabytes of memory and you're good to go, so let's press next, now we have to select our hard drive and this is just a way to select if you already have a hard drive created and what it is is a virtual hard drive. it doesn't actually exist, it's like a container so to speak, and I'm just using it as an example.
It is not the actual application that runs containers like Docker, but it is essentially a containerized file that is virtual and uses the virtual machine where all your files will be stored and the operating system will consider it as a real hard drive, but in reality It's not, it's just created by virtualbox, so what you want to check is that you want to create a virtual disk now so you can hit create. There are different types of hard drives within this application, there is the vdi which is a virtual box, this image, the vhd which is a virtual hard drive, and the vmdk which is a virtual machine disk, and I know it is a little confusing, but some of these are basically the format. of the type of virtualized hard drive that will be used for this operating system and the main thing that needs to be explained, the difference is that there are other types of hypervisors that use a different format, for example, I think the one used is vhd. by vmware, but we're not going to worry about that, we're just going to use the virtual box, this image for this demo, so let's move on to the next one, this is an important step that I always try to tell people when I teach themas.
To use virtualbox, there are two different ways to store the data within the hard drive: it is dynamically allocated and a fixed size now dynamically allocated means that the hard drive will only be as big as the actual files and as you add more and more files. Now it will grow to a fixed size. If you select a 10 gigabyte hard drive, it will take up 10 gigabytes of space on your system, so I always tell people to use it dynamically allocated that way, it will grow as you need it. It won't consume resources from your main machine, so let's go next and as you can see, it will store the virtual machine in one location.
I won't go too deep into that, but that's basically where the virtual machine is located. is stored or the hard drive itself and then also the size, you can set the size to 10 gigs or you can go even higher depending on how many resources you have in your system, for example I have a two terabyte hard drive inside my laptop where is found, that's why it shows two terabytes, but you can't use the full two terabytes because like I said, it runs on an operating system that is already installed, so if you don't have two Terabytes, which I'm sure you don't, because to all the files, folders and applications that I have installed on this system, I definitely don't have that space to give to this virtual machine, now you don't really have to worry.
If you select it, it will be dynamically allocated because it will only grow to the size it needs for the operating system and any files you put in the virtual machine, but I always recommend that people use like 10 gigabytes for just one installation that you're doing. for testing purposes, but let's go down and press create and that will conclude the setup and that was basically the initial setup of the virtual machine. We have to go into settings and make a few more changes before we start the virtual machine, so let's hit settings and you want to make sure that that virtual machine is selected that way it will open the settings for that virtual machine and we won't have to alter anything overall, but I'll go through it and show you at least the tabs now there's a shared clipboard drive and drag and drop can activate it, which I won't need for this demo.
You can write a description there and then they will also allow you to create this encryption if you want. We recommend that you don't do that, especially if you don't have it, especially if this virtual machine is just temporary and you will probably delete it in the future if we go to the next tab, which is the system where you can make changes. how do you configure the virtual motherboard for example that is the base memory and like I said I gave it eight gigabytes of memory but you can select it and make changes there if necessary and then it also has a virtualized boot order so you can know that when you boot a physical computer, a popup will appear by pressing F12 or F9 to select a different boot order or select something to boot first within the order from the BIOS, then you can make those changes here as well and then. some chipset information uh, you can enable efi for special operating systems you know, if you need it, I don't recommend you select it, just use the default value now in processing, you can give your virtual machine more processors, which I will increase mine to two Now I have a lot of cores in my system because I'm using a Ryzen on my laptop, so you select what's best for you, but two cores are enough for what I'm trying to do with this virtual machine.
I show you how everything works and then there is an acceleration tab that we will leave default now on the screen. What I normally do is increase the video memory to 128 and then enable 3D acceleration and then there are other tabs here on the remote display. and burn if you need it and then store this is where you want to add your iso so right now it's a virtualized ide controller which is the cd drive and all you have to do is select here where the little platter is and you can find the ISO by clicking choose a disk file and then all you have to do is go to your system now and find that ISO that we downloaded from Ubuntu a few seconds ago and once you find that ISO just select it and that actually add it to the virtualized CD drive and then as you can see here, this is the hard drive where we created the 10 gigabyte hard drive and this is where the operating system will be installed, but this is necessary to boot the operating system. to install it and I just wanted to explain it to people who are very new so they can understand exactly what we are doing and this is similar to installing it on physical hardware, which means that this ISO would normally be written to a CD. or a USB drive and you basically plug it into your hard drive and then your hard drive boots this CD and then writes to your physical hard drive that's inside your laptop.
Now I won't analyze the rest of these options, uh. but especially the audio network settings, now there's one thing you can change right here that I didn't think to talk about, but they have different types of networks that you can configure like net, which will basically use your IP address for this machine. and then they have an internal network bridge adapter, uh, host only, which I'll leave it like that so we can have Internet for this virtual machine and then also serial ports, USB ports, which I kind of leave most of these things off or I turn them off. disabled, but you can leave it at the default values.
Now let's go down and press OK and that has pretty much saved our configuration for the virtual machine and we can basically start it and store the installation, so there are two ways to start it. You can double click. in the real virtual machine either you get this down arrow or you can just press start but they have options down here they have a normal store they have a headless store and a standalone store and what you want to use is the normal store or just double click on the virtual machine and it will boot it up and as you can see it's popping up, it has our boot, you know, it automatically recognizes the CD drive that we had on the real system and then one thing with Ubuntu.
Review and verify your files before you open the installer. Now, one thing that Ubuntu will do is that an installer will appear immediately as soon as you boot the operating system and there are two options. The first thing you need to do is select your language, so if you are in a different country you can select the language that applies to you, but since I am in the US, I can select US or English, but the two options are: you can try ubuntu or you can install ubuntu. and that is what we want to do, we are going to install ubuntu, but you can test the operating system before installing and this is beneficial if you are installing directly on your hardware because from time to time you run on a system that is not one hundred percent supported but this is very rare but I try to tell people to use try ubuntu first that way it will verify that your system will actually run the ubuntu OS without any problem and it basically boots the system as if it was installed on the real computer with all the applications and everything you want to do to use the operating system, you can get it on the Internet, you can play with files, you can do pretty much anything you can. do it if it was physically installed on your hardware now, the only thing is that you download files or install something or whatever, it will reset if you reboot the system, so I won't save anything, which is basically called persistence.
Now let's check the installer. just by pressing install ubuntu, which is what I want you to do if you're following this course now, the first thing that will appear is the keyboard sorted by layout so you can select the keyboard layout that applies to you, but since I'm in the US. US, English, US and English, here and then you can also test the keyboard just to make sure all the keys are lined up and everything, so let's press continue and here it says which apps you'd like to use. install to start, you could do the normal installation.
Now they have a minimal installation. It will come with a web browser and basic utilities, but I will install the regular version so you can see all the software in it and then the updates. right here it will download updates while installing ubuntu because these packages or isos that are created are not always up to date, for example they will update the iso say once a month or a couple of months depending on the developers of the actual distribution, so sometimes you'll download an ISO and there's a couple of weeks delay in updating, so this will verify that you have an updated machine as soon as you boot into the OS and the installation is complete, so I'll just hit continue there.
I am going to leave the defaults now, this is a very important step, this is where you want to install the operating system, i.e. the hard drive, and one thing it says right there, warning that this will delete all your programs, documents, folders, photos, music and any other. files on any other operating system that is on the hard drive, so if you are installing this on physical hardware, you need to make sure you have backups of all your files because when you run this installation and you get to this step, this lets you know which will erase the hard drive and lose everything in the system, we don't have to worry about that because we choose to install everything in virtualbox, so this is an empty hard drive or a virtual hard drive with nothing, so we don't have to worry about that, but they do have options for you to configure the hard drive in your own settings, which I won't go into, that's pretty advanced.
If you are just installing this, follow the instructions. class, then I recommend that you select just delete this and install ubuntu and we can just click on install now and it will install and actually, I forgot the next step, the next step will ask you where are you located, uh. I'm on the west coast so I selected Los Angeles which is great and then you also have to select and create a user account and this is something that most Linux distributions want you to do, they want you to create a user account. user and do not use it. the root account which I'll talk about later in the course and I'll change the computer name to ubuntu 20 and then what you want to do is select a password or create a password, so I'll put that in there and just to give you a little bit more information. , one thing is that they have two options when it comes to logging in: they can log in automatically or they can require a password to log in, which I always recommend people use a password and then with ubuntu.
They also have it where you can connect to active directory, so if you understand Windows in active directory, you can add the system to active directory, which is a little bit out of the scope of this course, so let's go ahead and hit continue and hit me like. I said it's doing the installation and it doesn't really take long, but I'll come back when it's complete and since the installation is complete, you'll get a pop-up message that basically says the installation is complete and you need to restore the computer. To use the new installation, all you have to do is press restart and this concludes the Ubuntu installation part of the course.
Ok, our installation is complete and this is the desktop you will see when you log in to your Ubuntu 20.04. Now I won't spend much time in the desktop environment. Basically I'm going to do an overview of how to actually use the Linux desktop and then we'll dive into the terminal, which is where all the magic happens when it comes to the Linux operating system, so let's start by giving you an overview of how the desktop works and how to use it. If you use Windows or Mac OS, this shouldn't be too difficult for you. I can see that it has a main bar at the top that has audio tasks and hardware changes like for example sound settings here, here is the log out button or the power off button, so you can click there and that will appear and you can shut down the system, you can also modify your Internet connection, you know the simple things that you would see in the Windows taskbar or the taskbar of a Mac OS system and then here in the center you will see that you have the date and time and if you click on it, there's a calendar and then you'll also get notifications here, which is great to see now, if we go over here to the left on this actual taskbar, you'll see where it says activities that you can click. there and that will actually open up any processes that are happening on the system or applications that may be running and minimized on the system, like I'm currently running some updates on this installation and I'll talk about that later on how to do that.
Make updates to the system using the gui, if we click on that it will hide where it was and as you can see on the desktop it has folders so this is the home directory which is what they call it on Linux. system the home directory this is where all yourfiles and folders and I wanted to cover this so you can at least see that the files that we're going to create and manipulate using the terminal once we get to that point can be modified using the GUI as well and it looks different, you know, I'm saying that it is different from your Windows operating system and Mac OS operating system is different, but the concept is more or less the same.
You can double click on the folders and now open them. They're up there, they have a back button so they can go back and navigate the file system as needed. Now let me go down and close this because I want to show you that you have a trash, so if you delete something it will throw it into the trash and that will open up our file explorer again, which is another way to access it, so let's go ahead and close that again, by default you have a lot of software installed, especially on this version of ubuntu. when we installed it pretty much installed the default software that anyone would need or what they think anyone will need to use the operating system to its full potential and just to cover some of it if we go to the left side.
You'll see this taskbar on the left side, this shows you your favorite software that's there and as you can see, we have Firefox, so our Thunderbird web browser is a male client similar to Microsoft Outlook. It's also the same file explorer as when we click on josh it will open the file explorer and I'll open it again so you can see this is a music player and like I said I don't want to go through all the software I just want show them what's there by default. You can understand that almost everything on this system is installed to make the transition from one of these other operating systems much easier and, like I said, this is a music player, so we have uh, this is similar to Microsoft Word, now one thing.
I want to show you that it was the software center, so I'm going to go down and open it up, but that's how you get other software and so you can fully understand that Linux doesn't have the typical software that you would install. A Windows or Mac OS operating system has its own repositories or locations where certain free and open source software is located so that you can install and use it on the operating system and many of these applications are designed to be one for a comparison with the software that you would see on other operating systems, like before, what I was talking about, this is equivalent to Microsoft Word.
Well, you can actually write documents like Microsoft Word. You can even store the files in Microsoft Word format so you can jump around. back and forth with a particular file and you can easily modify it on your Windows system if you want, so I just want to cover that, but as you can see, this is the software, you can look at the explorer, they have the editors that they choose. So you can try and install some of the software. There are different categories so you can go through and see all this different software and then you can also check what is actually installed on the system and this right here does that.
It's very easy for new users to transition to Linux because it's not that difficult to install because once you find something in the browser list, let's say you want to install Signal or all you have to do is open the actual app or do click on it. and then there's the install button and it will install it on your system, so let's go back and I just want to show you that this is where you also update your system, but I'll show you the proper Linux way to update things once. We got to the command line part, but at least I wanted you to see it here, but this is where you can update all the applications that are installed on the system.
Now let's go down and close that because I want to show you how they do it. I have a help guide, so if you need help while using this operating system, the how-to guide will open. It basically goes through the overview of using the system and I really want to show you this because I know a lot of people who do it. taking this course or you are new to the Linux operating system, this is a great place to get help and this is why I use ubuntu because the community, all the documentation and pretty much everything is available for you to use, so you can fully understand how use it. the desktop environment as well as Linux in general, now we're going to close it, but like I said, this is the software updater that actually showed up and it's telling me to reboot now, but I'm not going to restore it right now, let's minimize this. because I want to show you some other things and here this is basically the installation ISO.
I left it on this system, but most of the time you want to remove it or you want to remove it from the actual system if you are doing a physical installation, if you did it using a USB drive or a CD drive, you want to remove that CD or remove the USB drive from the computer that way you can verify that it is booting from the hard drive, esp. If you've made any changes to the BIOS in terms of the boot order so that it doesn't keep repeating and going back to the installer instead of booting from the hard drive, now I want to show you how to access all the software that's installed. the system, as you can see, this is basically what is open, as well as the favorite software, but if you click here under show applications, a screen will appear and it looks quite similar to people who use Android phones, already knows how to swipe. and all your apps will appear, this is exactly what it looks like, but this is for a full system and not a phone, but you can access all your software from here.
I won't review them all, I'll just write. I wanted to show you that this is how you can access it if you need to use any software on the system and one area that I want to show you before we move on to the next section is the settings, now this is where you want to go if you need to make changes to this system in Generally, almost all of your settings are in this one location, like if you have the network settings, the bluetooth settings, if you have a bluetooth hardware bluetooth on your system, uh, the background, you can change the appearance of the notifications. uh apps, you can set your default apps here uh privacy settings so that no software or the operating system will track you.
You can also log into online accounts if you want, for example they have a way to connect. your Google account that way your email and all of that will connect directly to your Google account which is very beneficial and then you can also set up shared drives they also have sound power settings display settings and like I said , any kind. of settings you can think of or below here, if you have a printer at home that you want to configure, you can install the print drivers here, as you can see Ubuntu is really good, with this it picks up the printers on your network I have the printer a brother as well as a hp desktop jet printer that is on my network currently and it already picked them up and added them to the actual desktop and then also this is something that I was going to get to within the command line, but I wanted to show you that You can do a lot of these things I'm going to do on the command line from the GUI, but like I said, the power of Linux is within the command line, but you can also modify user accounts, which is brilliant.
It's great to have access from a graphical user interface. Now let's go down and close this and this will conclude the basic understanding part of how to use a Linux desktop environment. Now a quick note, depending on the distribution you use, the desktop environment may be fully visible. different than what I'm showing you here, but if you follow this course and install ubuntu, your desktop environment should look similar to mine shown here, but I just want you to at least know that in the future. Once you start playing with other distributions, the desktop environment may look a little different, certain things may be in different places, but the general concepts are more or less the same and that is why it is important that you understand how to use the terminal.
Because many of the tools and much of the software that you use within the terminal are used across all Linux distributions, let's move on to the next section and now we'll cover how to actually use the terminal and the first thing we want to do is basically show some of the settings for the terminal once we open it and basically what's called the terminal emulator and you can search for it in your applications, you'll see it appear, you can actually just search. Up here, type terminal and the actual terminal emulator will appear and as you can see, it should remind you of those old hacker movies where someone just types into the terminal, that's essentially what it is, it's just the terminal emulator.
So an app that allows you to interact with the operating system using commands and one of the first things that will appear that you can ignore, but talk about pseudo and I'll cover that a little bit later in the demo, where the app can actually help them while running certain commands now before I write anything I just wanted to show you some of the settings that you have for the terminal emulator and this is similar to any application. I can show you the settings and how to make it look. a little bit different, you know, using the options in it, so if you click here it will open the menu and you can just click on preferences down here and it will open all your preferences for the terminal emulator, as you can see.
There's a help button up here that will open up information on how to actually use it, but I'll walk you through it. This is the General tab and it has just basic information about what it looks like, like there's a theme they can change. the theme for dork you can open new terminals in a new window or you can open it as a tab, which is beneficial especially if you are working with different systems because you can connect to other Linux operating systems through the terminal and you can go back and forth using those tabs , so that's great, but if you have tabs enabled here this is where it will help you if you have tabs enabled here, so every time you open a new terminal it will open as a tab and you can specify the position you want it to appear in once to open, so at the end and then on to the next is the other option.
Now next up here I want to show you these shortcuts, this is something I think you should definitely check out. I'm not going to go through all these shortcuts, but there are many shortcuts that will help you while using the terminal and then you also have a profile and currently this is the profile. For us it has no name. In fact, you can go in and name it if you want. I'm not going to name him. I'll leave it as is, but this profile is linked to your user account, so if you log out, log back in to whatever you have set up. inside this nameless profile tab it will stay the same every time you log into the system, but as you can see, here you have a bunch of options, this is how you modify the terminal to make it look a little different, there are some appearance of the text uh, you can set the fonts, you can set the spacing up to the cursor that you see flashing right here, uh, you can modify it by making changes, you can change it from block to i-beam and I'll just go down and do it so you can see, I should change it, yeah, as you can see, the i-beam is just a line, uh, you can also change it to an underscore, like an underscore, and it flashes, and then you can also change. that where it doesn't blink I like the blocks I'll leave it as default but you can turn it off where it doesn't blink like it's blinking right now it should blink right now yeah and then here you have sounds for the terminal I never mess with any of this stuff.
I can change the colors, some of which are in the next tab and below you have built-in themes so you can modify them if you wish. It is set to use the system theme but you can easily modify it by unchecking this box and you can modify it using a theme that is already there or you can create your own custom theme by selecting different colors like attack text color background color bold color cursor colors and highlight colors and then they also have it where you can set the transparency in the background which is cool I like that and it's currently set to use system theme transparency so a lot of people just use the value default, which is not a problem. with it, but once you start getting familiar with using the terminal and the different applications and Linux in general, you can start customizing and modifying the system as you see fit, but below there are many color palettes for you to go through and select whatever you want and make the terminal look however you want now as far as scrolling a lot, I leave it as default, but this is basically if you're running a bunch of commands uh or something and you want to see what actually happened, the screen will scroll down while you execute commands, especially if it is a command that parses,say a lot of files or something then it will just scroll past everything and if there is an error you might want to scroll up and look at it so I leave it as default but you can scroll back and forth up and down through all the commands you've run, as well as the results that come from the command you actually ran.
There are commands down here, so you can run a specific command at login and custom commands if you want and then also keep the working directory just for the shell. That's just another option right there and then when the command exits the terminal you can set that. I don't recommend you do that, just leave the defaults, you should be fine and then also under compatibility, there are some changes there, but we're not going to mess with that at all. Now let's close the preferences and one thing I want. What you need to do is zoom in so you can see a little better because it's hard to see things inside the terminal unless you make it a little big, especially while recording, as you know, I'm recording this in a virtual machine, so It's a little difficult to record where you guys can see everything without expanding it, so I hope you can see this, but this is what you'll be greeted with when you open the terminal for the first time and it's only showing this here because this is our first time. which I run on this system and just to break things down, the first thing that will appear is your user account, so we know that when we install this operating system, I set up a user account as Josh, which is my name.
It will show whatever your name is or whatever you set during installation and then there will be an at symbol, so it's similar to an email address. Look at it that way, you will have the at symbol and then after that there is the system name, so this is the name that we actually gave the operating system when we did the installation and then after these two points that basically explains or shows where you are, that's what this tilde is for and we're currently in the home directory and then after this. this is where you actually type the command so you can type it there and that's where you actually execute your commands and the first command that I finished showing you is the most important command that you will learn using the terminal and that command. is man and man basically means manual and this is something that I will use with every command that I show you that we execute inside the terminal. man basically gives them information about any command they are trying to run within the Linux terminal. and let me give you an example, the first example I will show you a command and I will show you the manual is man space man.
Now that's the manual for the man command, so essentially every time you run the man command, whatever you're looking for or whatever manual you're looking for you have to put that command behind it so there are other commands like cd, you can put cd behind man and that will open the manual for the cd command, but like I said, we want to see the manual. for the man command then it's man space man and press enter and you'll see the actual man will appear, the manual for man as you can see here, it just breaks this down, shows you the actual command and then it says man page utility for man utility and then it gives it a name, a synopsis of basically how to use the command and a description of everything related to that command and it does exactly the same for most of the other commands within the Linux operating system and let's read the name quickly, like this that man and the interface with the system reference manuals.
Now at the end of the day there is basically a small database running on the system that houses all the manuals for all the different commands and you can use the man command to open those manuals and they will appear in the terminal like this and to navigate everything that What you have to do is use the up and down arrows and that will move up and down throughout the manual terminal and like I was saying there's a synopsis so it shows you some of the options because many Commands also have options that allow you to modify the results of the commands, so just to break it down the first one says manual options section page etc. so you can modify the results that will appear when you run that actual command and then this breaks down the description and like I said this is in every manual for every command that is in the operating system and the information here is very beneficial when you are first learning how use this and in certain cases there are examples of how to actually use the command so you can check them out, they explain what they are actually doing while using the option and you can try some of these examples like well, running them on your own and the way Exiting these manuals is simply by looking at the bottom where it says press h for help or q to exit, so all you have to do is press the q button and that will actually exit. you left out that command, so congratulations, that's the first command you've run inside the Linux terminal and as you can see, it's super simple, but I want to highlight again.
It's very important, especially when you're starting to use the Linux terminal because there is no way in the world that you can remember all of these different commands and how to use each of the options in them, so if you're trying to solve something using a command that you've never touched before or a command that you haven't touched touched in a long time, so the man command is definitely beneficial now that you guys have a full understanding of the man command now I want to show you how to actually work with directories within the shell now I showed you before you can navigate the shell by just opening the file explorer and going through and just looking at your documents or the different folders that you have, there is a way to do this inside the terminal and I'll show you a couple of commands that can help you work in different directories and the first command I want to show you is the pwd command, so we're going to use that man command again and I'm going to use it for every command that I run so you can see it. that the man command helps you understand the commands so let's type man and then pwd and press enter and that will open the pwd manual and as you can see its name is pwd and print the name of the current working directory and this.
It is an important command because when you browse through files and folders in Linux operating system you can easily lose track of the location you are in and this command is important because it will allow you to simply type this command and it will show you the location you added now, let's press q to exit and let's go down and run this command now and type pwd and this is actually running the command and we can press enter and that will show you the working directory. and remember when I mentioned the tilde represents the home directory.
Well, everyone's home directory or all users of the operating system will have a folder under the home directory that is just a folder in the file system and will be named after their username. Let's click here under Files and I want to show you the location of this so you can see a GUI representation of it as well, so in front of it it looks like I have to go to other locations and the computer will appear, uh and That's basically what I want show you, so we click on computer, this is the root directory, which is represented by the slash right there and then what we're looking for is the home directory, so that's that home directory and then Josh. directory, so it's essentially the same location as the home location here, you just don't see it, they hide it from you, but it's there and that's one of the powers of using the terminal: you can see the exact location where you are. and this goes into absolute path versus relative path, which I'll give you a quick overview of what it is and the absolute path is the full location of a file, folder or directory, so home and josh and then a relative path is an assumed route. which I'll cover a little more once we get to the cd command, which is next.
Now let's open the cd man page, so all we have to do is type man and then cd and basically cd means change directory and like You can see that certain commands don't have a manual, especially if it's a very old command and you wanted Do this on purpose so you can see that some commands you may come across won't have a manual, but most of them do. It's just that the cd command is so old and has been around forever that they assume most people know and understand what it really means, but the cd command is simply a way to change the directory, that's what cd means. and just to show you a quick example. of how to use the cd command we can just type cd and then let's say we want to go to this home directory, we just want to go to that home directory and this is what I was saying about relative path versus absolute path, but let's type home and we can press enter and that will take us to that directory uh and as you can see right there the tilde disappeared and now it shows the actual location where you are located and the tilde was just just a representation of home and josh now This gives me the opportunity to show you a relative path, which basically means that the system understands where they are, what is the home directory at the moment or the home folder, and a relative path would be changing the directories to the josh folder inside home, etc.
If we press Enter there, we'll go back to our home directory and just to add a little bit more about Linux, you can do things in different ways, so there's not just one way to do certain things because that set us back. to our home directory and if we go back to the home folder by typing the home path and press enter, we can also just type cd and that will also take us to our home directory because by default it will take you back to your home directory Of start. no matter where they are, it will take them back home, josh or whatever your username is.
Now the next command I want to show you is the ls command, so let's type man and then ls hit enter and that will give you the details. from this actual command or from the manual it says to list the contents of the directory and then it also gives you the synopsis of how to actually run it as well as the options and let's press the q button just to get out of that and I downloaded some files for us. to play with this command and they are located in another directory so we have to use that cd command like we just used but we just need to type cd and then the folder it is in is under the documents folder and there is a folder below it is called ansible.
I saw that all we have to do is write ansible examples and press enter and that will change us. Our current location is inside that ansible directory. Now let's play with the ls command, so all we have to do is type ls and press. enter and that will list the contents of the current working directory, this is essentially how the ls command works, as you can see, you can see all the folders that are under it, as well as the files that are under it, and if we go back to our explorer and we click here under documents, you will see the ansible samples folder and you will see exactly the same information that appears in the terminal.
Now this will be a good example to show you one of the options that can be run with the ls command and this will show you how powerful the ls command is now inside this directory there is a readme.md and Linux has hidden files and folders like in the Windows operating system and Mac OS, but in To do something hidden, Linux uses a different designator for hidden files, which is a dot, so any file or folder that has a dot in front lets the Linux operating system know that this file is a hidden file and therefore do not do this. show it unless you have it set where it shows hidden files and it's readme.md.
What I'm going to do is just change it by going to rename and putting a dot in front of it and that will actually hide that file so we can hit rename as you can see it's gone so the file is hidden now but if we go back to the terminal and we write ls we will see that that file has also disappeared. There's a good example of how to use an option with the ls command or any command in general and that's why it's important to understand how to look at those man pages is that there is a way to show hidden files while using the ls command so we can type ls and then I know the option at the top. my head but it's just a script for everyone so basically it's going to show you all the files whether they're hidden or not so let's press enter boom and as you can see it's going to show you that hidden file and by default when I downloaded.
In this github directory they already had hidden files, but I just wanted to show you how to hide something and how to see all the hidden files. If you want to see them now, there is another option that I want to show you. can be run using the ls command and one thing I want to do is clear the actual screen and basically all this does is upload all of thisinformation, so we're starting out and it looks like it's a new terminal by typing the clear command as you can see, it basically moved everything up. Now let me run the ls command again so you can see an example of what is displayed when you run the ls command without options, but I also wanted to show you another option which is So if we type ls and then the dash l, that means long or is a long view and puts it almost in a table so you can see a lot of information associated with the specific files because right now all you see is just the files in general but it doesn't have any other information besides just the name of the folder, so if we press Enter boom, that's going to give us a lot more information, as you can see, it's broken down into a format that you're going to start to recognize and understand and this goes into the permissions part that I'm going to show you later in the course. , but as you can see, it gives you a lot more information about these folders and also shows you when they were actually created and also. as the owner and group of the actual files, this lets them know that josh, the user, owns these folders and files.
Now there's one thing I want to show you guys too and we'll use that l option again, but you can also run options together, so let's type ls and then the l dash and the a option and we don't have to put two dashes. We could just put them together and the system will understand it and press Enter and that will run it with everything and that Bring our hidden files and folders so you can see that the git ignore file is there as well as the dot md readme file. Now let me show you one more option that you can really add to this and that is the h. option that puts things into a human readable format and if we look at the man page which I'm not going to open again but the h option is there you'll see it but one thing we're going to run is ls and then the l script and then the a option for all and then the h option and just to explain it before you run it as you can see that all of these files and folders are in a byte format which is the actual size of the files right there.
This column right here in the middle is the size of the files and folders. Now most folders are represented in 4k, which is normally the size of a folder, no matter how big something is in it. It will show up as 4k, but it's in the smaller format, so if let's say we're looking at a file that is one gigabyte in size, if you run it without h, it will have the size in bytes and it will be hard to figure out what it is, so let's press enter and that way I can show you the difference.
As you can see, it's in 4.0k, basically putting it at the size to be human readable, as you can see this. The file is 31 bytes and the dot md readme file is 121 bytes. Now let's go down and clear the screen again and press the CD button which will take us back to our home directory and we can delete again quickly just to go back up to The top command and the next one I want to show you is mkdi mkdir which means create directory . Now let's go to that man page by typing man mkdir and press Enter and that will open up that manual and as You can see it basically means creating directories and then there are a bunch of options that you can go through and check this at your leisure, but let's see and show you how to actually use it, so let's press q to go back to the terminal and let's go to our documents folder using the cd command that we just learned and then type in the documents folder and press enter and as you can see now we are in that documents folder and if we use that ls command we just learned that we could press Enter and we can see that we only have one folder inside this directory in the documents directory, so let's say we wanted to create another folder inside this directory without using the GUI.
You can use the make directory command, so let's type mkdir. and then you want to put the name of the directory that you want to create so I just created a test directory and hit Enter and that will create that directory for us and most of the time when you run a command inside the terminal with no output it's a good thing that you lets you know that the command ran successfully now, if something happened then it would have given us an error and just to give you a quick example of that, if we run the same command again to create the same directory name, so try a capital t and press Enter.
You will see that it will give you an error that basically says the directory cannot be created. The test file exists, which means the folder is there. Now let's use the ls command again so we can see that folder. has been created in that location, so if we type ls press enter, that will show you all the folders that are in that directory and you should see that the test directory is there, so now let's say we want to create a folder under it. The easiest way to do this is by typing cd and we can go to that test directory and create another folder, so let's type mkdir and then type test2 and press enter and it will create a folder for us under that directory, so if we type ls boom below from that director, you'll see there's that test two folder, that took a little bit longer and like I said, in the Linux terminal, there are multiple ways to scan a boundary.
You could have created both directories. at the same time and I will show you that using an option with the make directory and what I am going to do is cd from that directory and what I want to do is go back to the documents folder which is where we were We create the first directory and press ls again so we can check where we are or we can also type that print working directory, which I won't print because we know which directory the tilde is listed here, which is our home. directory and then the documents directory.
Now let's create a parent folder and a child folder using an option with the make directory command and all we have to do is type mk dir and then the option which is dash p and now we can specify a parent directory. in a child directory and you can go as deep as you want when it comes to creating the folders for a full directory tree so the folder I want to create I'll just create the folder uh linux linux and then to create a folder under that folder we just have than put the forward slash and then let's type ubuntu and then say we want to create another folder underneath just to take it to another level, we could type josh in there and press enter and it will create that entire directory tree, so if we are inside this directory under the documents where we created that Linux directory, you will see that we have that Linux folder now, if we cd to the Linux directory, press enter and if we are again, we will be sure that we have that ubuntu folder that we created now if we enter the ubuntu boom folder and you type ls again and you'll see that it has a josh folder and you guys should have an idea of ​​how that actually works so I'm going to clear the screen because I wanted to show you the next command which is how to delete a directory.
Now we're going to cd to go back and then cd to our documents directory and hit enter and go to ls again so you can see the folders that are there. in that directory and the next command I want to show you is the delete directory command so let's type man and then rm dir hit enter and that's the manual for delete directory so it says delete empty directories. Now the word empty is very important when it comes to this command because you have to run an option to delete a folder that has files or directories under it and I'm going to show you how to do it once we run the delete command, so let's press q to exit and do it. first thing I want to do is go to the test directory and I just want to show you a simple way to delete a folder so you can see it has that directory test.2 under the test directory so in order to delete that test from the directory and we know that that folder is empty because we didn't create anything under it, so all we have to do is type delete directory and then we could type test two, press enter and that will delete. directory for us, so if we type ls again you will see that the task 2 directory is no longer there, otherwise it would have appeared like here when we first ran the ls directory.
Now let's type cd and go back to our home directory. Let's go back to this documents folder because I want to show you an option on how to delete a parent and a child folder, so if we press Enter there, we'll go back to that documents directory and type ls to list its directory the contents of that directory now we know that the linux folder has multiple folders under it and just to show you that you can't delete a directory with a directory, I'm going to run the delete command on that linux directory that we created and we'll press Enter and as you can see it says you can't delete the directory from Linux because it is not empty, so to achieve this we use the same option that we used to create a parent and child folder when we run the make directory command, which is hyphen p and you.
We will start to learn that many of the options are quite similar, so run it now, delete the directory so that rmdi or dash p and then we have to specify all the directories, so if we type linux first and then there is a ubuntu directory under that. and then the josh directory as well and if we press Enter there, the entire directory tree will be deleted, so all the folders under it will be deleted, as well as that folder, and if we list this directory again, you will see that it is completely gone, Alright. Now that we understand how to manipulate directories, let's move on and learn how to manipulate files or create files, delete files and the first thing we need to understand is that all files in the Linux operating system are case sensitive which means you can create files. with exactly the same name the only difference is the case of a particular character within that file and that will be recognized by the Linux operating system as a totally different file and this is very different from the Windows operating system in Windows a file no matter where it is within the same directory, you can't have exactly the same name no matter the case, so this is one of the big differences when working with files and Linux that you have to understand and then not completely confuse them, but in Linux. operating system everything is considered a file, even directories, the Linux operating system considers them a file.
It's a special type of file, but it's considered a file anyway. Now the first command I want to show you is the file command. It's very simple, so let's open the man page for the file command and we can type man and then file and press enter and the manual for the file command will appear, so it says determine a file type and then here there's the synopsis and then also the description of what that is, how it's actually used and then we can go to the end and it will also show you some options that can be used with the actual file command, so let's go out and I'll show you some of the examples basics of use. the file command and before writing the command I just wanted to explain that the Linux operating system does not use extensions to determine a file type.
There are now apps at the top that will use the file type to show you which app can be opened. the file, but as for the file type, it's not determined by the operating system if that makes sense, so this is another reason why the file command is very important, especially if you work on the command line full time . Now, let's get into our documents. directory and look at some of the files using the file command so boom and then let's go to this directory uh let's go to the ansible examples directory and then let's run the ls command again and let's go to another directory quickly inside of here and what Basically what I'm looking for is a simple file that we can play with and see the type of file, so if we are in this directory we should find something that yes, so what I'm going to look at is the readme.md file and the way it uses the file command is just the command itself, which is file and then the file that you want to view using the file command, so let's press enter and that will give us the information about this actual file, as you can see. a text file and that's basically what the amd md file is, it's basically a markdown language, but it's essentially a text file and now we're going to run it against this uh, Rollingupdate.gmo, so let's write file and then let's do click on update.yaml and let's press enter and see what it shows and it also appears as a text file and let's go up a directory because I want to find another file so let's go to this db folder and see what's in here as well, I think it's some images. so our images directory and let's go to this directory now let's see what's there so let's see use the file command to look at one of these files now we already know from the extension what it is but this is a useful tool to give you more information about a file now, as you can see, this is thefilename then this is a pn png image and you can see the resolution of the actual file as well as the color it colors the rgb rgba and it says non interlaced but that's Basically an image file should help you understand the command archive.
Now the next command I want to show you is how to create files from the command line, so let's go to the CD or change the directory to our home directory and clear the screen and the The command I wanted to show you is touch, so if we type man and then we tap, this will give us the manual for the touch command and basically what it says is that it is a file change time step, but the main purpose of using the touch command is to create files, but they can do other things as well like changing access and modification times as well as basically creating empty files, so let's go down and get out of that and show you how to use the touch command and let's go back to our documents directory and use the touch command to create a couple of files now the basic way to run the touch command is just touch and then the name of the file so we can name it file one dot txt press enter and if we use the documents directory lsd we will see that file 1 has been created now let's go down and create multiple files using the touch command and basically all you have to do is list the files, so let's create, we already have file one, let's create file two dot txt and file three dot txt and those are the two. files and basically I'm showing you that you can create more than one file at a time using the touch command, you just have to separate them by a space, so let's press enter and then list the ls directory again and we'll see that all three of those files are there and like other commands the touch command has a lot of options where you can change things about a particular file but I'm not going to explain that I just wanted to show you the touch file and this is the easiest way to create empty files on your computer now that we learned how to create the files let's go down and learn how to delete a file which is very simple it's similar to the delete directory command but instead of rmdi or it's just rm so go to the man page quickly so we can type man and then press Enter, it says delete files or directories and it basically covers how to use the command as well as a description like all the others and also options that you can use, so let's leave that and do some examples of deleting these files that we already created, so the basic way to delete a file is just rm and then the name of the file, which is file1.txt, which is the first one that I want to delete, so we press Enter and that will delete that file , so if we execute the ls command we will see that file 1 has been deleted.
Now in the same way, with the touch command you can specify multiple files, so we all have to What I do is I type rm and then what I want to do is show you one of the options for the delete command, which is the i script, which is considered interactive mode and it's basically a way of running the command where you check that you want to delete these files so let's type in the names of our files so file colon txt and file and Present three dot txt and press enter and it will check it and it will make you check each of these files and it says delete the normal empty file and you should respond by typing yes and press enter and I will delete that file. and then we have to type yes again and I will delete that file, so now let's run the ls command again and both files are successfully deleted from the file system.
Don't you remember how I said there's more than one? way to skin a cat inside the Linux terminal, you can also use the delete command to delete directories as indicated in the man page and I want to show you how to do it now using this test directory that is already there and in order. to delete that directory, all we have to do is type rm and let's try it without using any options, let's type uh test and press enter because I want to show you what the answer is as far as the error that will appear when you try it. to delete it without using any of the options, as you can see it says it cannot be deleted.
The test is a directory so to remove a directory you can use rm and then there is a recursive option that's what or recursive means and then force. and this will force the delete command to delete that directory so let's press enter and that should delete that directory and we can use this directory as you can see the test directory is gone so I just wanted to include it in there so you guys can Let's see that there are several ways to do things within the command line. Now let's go down and clear the screen again and the next thing I want to do is show you how to copy files, so the first thing I want to do is create a directory. so we can go to create directory and then create a directory called test in the documents directory unless ls to make sure that directory has been created.
Now let's create a file inside the test directory so we can access that directory, that's the easiest way and press Enter and then ls this directory, as you can see there is nothing there, so now we can use the touch command, so tap and then file a dot txt and press enter, that will create that file inside the directory and as you can see it appears there. once we execute the ls command now let's say we want to copy that file within that same location, well all we have to do is type the copy command which is cp.
Now first thing before we copy I want to show you the man page for is so man copy basically copies files and directories and then all the options that you can use with the command so let's go down and get out of that and run the command and do some examples , so all we have to do is type cp and then you want to specify the file you want to copy and then you want to specify where you want it and the name of the file, so we want it in the same directory so we don't have to type anything before the file name, we can name it file one. cp dot txt and press enter and then if we are in this directory, we will see that we have the copy file and the original file that we copied from now, let's say we want to copy one of these files to a specific directory within the file structure. all you have to do is type copy cp command and then copy the same file, so it files a point txt and we want to copy it to a specific location.
Let's copy it and place it inside our documents directory. Now we can write the absolute. path that way we know for sure that we are getting the file in the right location so we can put the forward slash which is our roots and then the home directory and then josh and then let's say we want to put it in that documents directory like we said and that's all we have to do unless we want to rename the file and we'll just put it in that location by pressing enter and if we're in this directory you'll see that file one is still there but we can It's a specific directory by typing the path complete so we can move forward, forward slash to home josh and then documents and press enter and that will show us the file that we placed in that location.
Now let's upload a directory and how to upload one. directory yes I didn't show you this, but it's cd change directory dot dot and that will take you to a directory as you can see we go up a directory in a tree and I think I forgot to explain that when we covered the cd Command I just wanted to keep it simple and not confuse people. people, but that's the way you upload a directory while using the cd command. Now you return to the copy command. If we want to copy a directory, it's a little different.
We have to use it. a script or option to copy that directory as well as all the files inside it, so all we have to do is type cp script or and then we want to copy that test directory, that test directory and I want to put it in the same location so it's exactly the same all we have to do is type a name so let's try and then cp that's the directory name and we press enter and if it's our documents directory we should see two folders there, now one. test and one test cp, which is the copy.
Now let's go to that directory as well, so let's test cp because I wanted to show you that it has those files in there that we created during the test, so that should be a clear example. of how to actually use the cp command now let me clear the screen quickly because the next command that I want to show you has two features involved and it is basically the move command, you can move files and then you can also rename the files and This is what a lot People use with the move command, for example if you have a file called file 1 and you want it to be called file 2 within the same directory, many times people will use the move command to rename those files. inside the command line because it's basically a faster command, it's just two letters to rename a file, so before I show you the command, let's go to the man page as usual and to the move command, let's press enter and as you can see in the man command.
On the page it even says that you can rename files with it and it also goes over the description as well as all the options for using the command, but I'll show you the simplest ones if you want to go further then definitely check out. man page, but let's exit and then move this documents directory back because I want to show you the easiest way to run the move command by renaming the 1.txt file and I'm going to do exactly that example that I said a few minutes ago. does so let's just type move and then filename uh file1.txt and we want to rename it to file2.txt and we'll leave it in that same directory so we don't have to put the path in front of it and You can press Enter and unless it's this directory and we will see that file one is now file2, so that is a simple example of using the move command to rename files and then you can also move the file through that process by specifying an absolute path that will be I'll show you now, so let's type move and then capture that file into a file and we want to move it to the test directory and then we'll also rename file three just to show you that you can do all of this. a command so let's press Enter and that will move the file to and if we have this directory just to show you that it's gone, let's try the LSD directory and press Enter and that will show us that we have that file three there so basically We've moved and renamed at exactly the same time using one command and you can also do exactly the same for directories with the move command, so let's select the documents directory again and what I want to do now is rename the cp from test to test. pc and I apologize, I wrote the wrong command.
I put the delete command in there, which I wanted to put mv in, so let's apologize for that, but let's go down and forward, but we're going to run the same command, I'm just going to change. put it in the correct command and I'm glad it didn't work because it's a directory. You would have lost that file or directory but anyway run it now and we should be good to go so let's set this directory now and it should be try the PC so I apologize for that and even your instructor makes mistakes but let's move on and By showing them all these commands, they should be able to manipulate files within the Linux file system, so make sure you practice these commands because once you master these commands, then there are more commands and more options that you can use in the future.
Okay, now that we understand how to work with directories and files, I want to show you how to work with the content inside a file. There are a couple of commands I wanted to show you that will help you do this. Now, the first command I want to show you is the main command, and as always with every command, I'm going to show you the man page first, so hit Enter. As you can see, it generates the first port of a file. Now the purpose of this command will print the first 10 lines of a file and it will do this directly inside the terminal and this is so you can get an idea of ​​what it is. actually in the file, so let's exit the man page quickly by pressing q and find a file to use the head command, so let's go to the lsd documents directory and you may need to go to another directory.
Yes, let's go to the ansible directory again. enter and ls again so we can list the contents and let's go down and run the head command against the readme.md file so let's go down type head and then readme dot md and press enter as you can see it extracts the first 10 lines now it's a bit hard to count, but spaces are also a line, that's why it shows the content in blank lines as well as lines with content, but they are the first 10 lines of the actual file, now there is an option. where you can display a certain number of lines, let's say you only want to see the first five lines of this same file, so let's press up,let's run that command again and run script five and hit enter and that will show you the first five lines. of that line instead of the default value of ten, so it's a cool way to use the head command and now that we know how to use that command I want to show you another command that is very similar to this one and the difference between this command The head command and The command I'm about to show you is that it shows the last 10 lines of a file, so it's beneficial to use both commands if you're trying to find out what's in a file without opening the entire file. file and the command I'm talking about is the tail command so we can type man man tail and press enter and as you can see it says it outputs the last part of a file and exactly the same as the head command but it's the total. opposite while showing you the last 10 lines of the file, so let's go down and get out of that and run the tank tail command against that same file and press Enter and as you can see it pulls the last 10 lines of that actual file and just so You guys know that this file doesn't have a lot of data.
I think it's about 10 lines long, that's why it shows exactly the same information as the main command, so let me find another command to give you a better example so we can get into it. the directory lamp uh and press enter and let's find this directory and let's find a better file to look at and let's look at the site.yaml file and let's run the header first so go ahead against the site file and press enter as you can see it extracts the first 10 lines . Now let's run the detail command exactly the same way and press Enter and you'll see that the information is different and those are the last 10 lines of that file and I wish I had found this file first because it's a better example, as you can see, the information It's totally different from when we ran it the first time on the original file that only had a little bit of content.
Now let's go down and clean up quickly and I wanted to show you another command. which is the cat command and since we're deep in a directory, let's go down and make the terminal full screen that way you guys can see everything and let's clear the screen again and run man cats, which is the command I'm about demonstrate. you now and cat are short for concatenate files and basically what this command is used for is to print the entire contents of a file, not just the first 10 lines, not just the last 10 lines, but the entire file, so let's leave that and let I show you how to run that now so we can run cats and then the site dot yaml file hit enter and as you can see it extracts that entire file and we can scroll up and see it but as you can see that it's the entire file right there, so it's just a quick way to print everything.
Now the cat command, as I said, means concatenate, so you can take information or content from multiple files and concatenate that information into one big file using the cat command, which is one of the most advanced features of the cat command, so let me I'll show you how to do this by creating a couple of files and then I'll concatenate the information within each of those files into one large file. Now let's go to cd and then quickly clear the screen so we can bring everything to the top so you guys can see it now, let's change the directories to our documents directory, press Enter and let's select this directory because I'm going to have to create a couple of files quickly and I've already done it.
I didn't show you the echo command, but this is the easiest way to create a file along with its contents, so let's first look at the echo man page. I just wanted to show you this, real quick, but hit enter and echo. It will display a line of text. This is a simple command. that's been around for a long time and it allows you to display information and really all we have to do is type echo and then we can type some text and then I want to type d and put it in an actual file inside this directory and all we have to do is type text one or whatever you want to call it dot txt and press enter and that will echo that file name as well as create that file for us and if we have this quick directory, so you guys can see, you'll see that the text one is there and if we cut that file and I just wanted to show you this, we cut that file and press Enter, you'll see that the word d is there, now let's run the exact same command uh echo and put something different in there so you know so what I'm doing is I'm hitting the up arrow which is going to show you the commands that you've already run, but let's see and type this actual file big and hit enter and that's also text and run it one more time and create a file called test text. three and let's put a word here also the big apple so type apple in that form in that file now let's cut each of those files quickly so you can see exactly what's in each of those files and we'll start with test one press Enter and then test two and then test three or text three, press Enter and so on. as you can see, the big apple says, now look at this, if we run the cat command against those three commands, we will see all the text printed from each of those text files, so let's type cat and then we can type test. text one and then text two and then text three and press enter, as you can see, it puts it all together, so that's what King Kat, that's what concatenates, it means which will put the content of multiple files into a single printout and you can extract it as well. all to another file which is a little more advanced, but I just wanted to show you that it's possible to do this by just running the exact same command, but instead of sending it to the terminal, I wanted to send that information to a file, so let's create another file and all we have to do is type the greater than sign and we can name the file dot txt and press Enter and if we have this directory we will see that now we have another file called all, so if we cut all the files quickly, we will see that the text is there, so we basically take the text from text 1, text 2, text 3 and put it all in one file, which is great and just think of the possibilities when doing something. so if you have a file with 100 lines or a couple of files with 100 lines in each of them and you want them to be combined you can simply use this with the cat command to do this now let's say you want to create a file and you want to write the content within that file.
I want to show you the easiest way using the cat command. This is another feature of the cad command and let me clear the screen so we can go back to the top, but Let's start by creating the file using the cat command and what we need to do is put the greater than sign and then we can name the file as we want, so let's name this file with a dot txt and press Enter and then whatever you want. I can see that the cursor is stuck on the left side because we are using the cat command to create the file and then write the content to the file, so all we have to do is write what we would like to say so we can write I'm having a Good day and then you can add more than one line, you don't have to keep typing, just press Enter and it will take you to the next line and then you can continue typing, I hope you are too. now let's say you have finished writing everything you want inside this file so you can save it, all you have to do is hold down the control button and press d and it will take you back to the command line, now I know that's nice.
It's weird where to put it, but let's press Enter just to get it out of the way and now let's grab that file quickly so we can see exactly what's in it and press Enter and that'll cut that information out for us and it should. I've put a return at the end, that's why it puts the terminal prompt right after the end of the file, which makes it look a little strange but that's essentially how it works, but if you follow that process you can create the file and write it out. on the content you want to write to the file and then save the file to that location.
Now let's press enter again because I want to find this directory because I don't think we showed you that the file was actually there, but as you I can see file one, which is the actual file. Now there is another interesting feature of cat that I want to show you. They can actually copy files or they can use it as a copy for a particular file and if we cut the file one again like that. we can look at the text again so you can see what's in it, we can copy that file and rename it using the cat command like this, so we can write the cats file one and then all you have to do is put the greater than sign and then name the file whatever you want so I'm just going to name it file 2 dot txt and press enter and if we find this directory again you will see that there is a file 2 and if we run the cat command against file 2 it will show us the contents of that file , which is exactly the same as file 2.
Okay, great, now we understand that we are going to clear the screen because I wanted to show you another command that helps when working with files. Now this is typically used when you have a very large file that you're trying to go through and look at and this command is called more so we can type man and then more and this will give you information about it, but basically it just parses. it sends data to your terminal, but it allows you to scroll through different pages and I'll show you how to actually use it once we get in and I found a quick file, let's look in the ansible directory and then in the hp i lamp directory.
I think proxy press enter unless ls is directing I just want to try to find it in the provision.yaml file so let's run more against the provision dot yaml file press enter and as you can see at the bottom now this is running more programs. you show the percentage of the file it's in and you can also go page by page instead of going line by line with the cat command, where it just prints everything, let's say you want to see everything, like uh page by page, if you press the bar of the space button, it will go to the next page and if you press it again, it will go to the bottom of the page and that is a super beneficial command, plus there is now an alternative that some people like. use which is less and I'll show you how to use it against the same command, but first let's go to the main page of less so you can see it, but it says the opposite of more, so let's type it in and just run it quickly, so let's go to less and then provision and file again just hit enter as you can see it's pretty much the same thing you can also use tab and you can go back up you know what I'm saying and go back you can go line by line as well with this command , but if you press space, that will take you to the end and all you have to do is press command q, which will close the actual command, but that's essentially a higher overview of less. command and the more command and this concludes all the commands that I will show you that will allow you to manipulate the content inside a file in the Linux operating system, so let's move on to the next segment, okay guys, in the next segment I want to show you a description high level overview of how the Linux File Six system is structured and I'll show it to you by basically showing the entire file structure in the terminal and then breaking down each directory under the file system, so let's go down and press. cd and then the forward slash and this represents the root of the file system and every file included within the operating system is stored in this location.
It is similar to the Windows operating system as everything is structured on the C drive. Well, it is the same but a little different within the Linux operating system, so let's press Enter there and what I want to do is run the ls command and then I'll run the dash l option and this will give us the full structure of the operating system and I. I'm going to scroll up a little quick just to get everything in so everything is listed and I'm going to go through and break down each of these folders and like I said, this is going to be a detailed overview because I don't want to go too deep and confuse new users. of the Linux operating system.
Basically I want to explain what many of these folders are used for and this will give you a better understanding of how the operating system works well and the first directory I want. To show you it's the bin directory and this is where most of your binaries are stored. Now this means Linux terminal commands and core utilities like the cd command that we just used, the pwd command which is printing the working directory that I showed you. guys, a little bit before, just like the move command and so on, this is where all those binary files are stored.
Now the next directory is the home directory and this is a very important directory and you don't want to mess around. This directory here is where all the files needed for Linux to boot are saved or booted and many people who are used to running Linux usually separate this directory into apartition different from the rest of the operating system, especially when you are working. or do dual boot, but that's a little high level for you guys, I just wanted to give you an overview of what this folder is for and a little more of an idea of ​​what is in this directory: the boot files, as well like grub most of the time, which is a small program that allows you to select the operating system and start the operating system.
Now the next directory is cd-rom and obviously that's where your CD drive is stored, so every time you put a disk into your Linux operating system. system, it will appear on cd-rom. Now the next directory I really want to talk about is the development directory, which is the next directory down and this is where all of your physical devices are mounted, so all of your hard drives, uh, USB optical drives and the reason. Why I say CD drives with optical drive is because they can be mounted in this location or stored in this location. It all depends on the different distributions.
Different distributions store things in different places. Sometimes they have an extra directory here and there. That's why I didn't do it. We don't talk much about the CD-ROM folder, which is obviously for the CD drive, but it is typically stored and depending on the distribution, CD-ROM drives are also stored in development, but all hard drives are stored at this location. they are actually mounted from that location and also if you have multiple partitions on a single disk those will also be stored in this location and you will see that once you start digging into how to partition a hard drive.
For your Linux operating system, now the next directory that I want to explain to you is the etc directory and it basically means etsy, but this is where all the configuration files are stored and this is for all the applications that are installed on the Linux operating system. system so let's say you want to install an apache server they will have configuration files stored in the etc directory or if you want to configure my sql or if you are trying to modify your ssh connections or your configuration for your ssh server then the configuration file is below and most of your configuration files have a conf extension so c-o-n-f is fine so the next directory is basically the home directory and I explained this to you when I was showing you how to navigate the Linux file system.
When using the cd command, the home directory is where all username folders are stored, so every time a new user is created on the system, depending on whether that option is selected or not, a new one is created. home folder and this is where all your documents are located. and the photo and video files are all stored in that user's home directory, which is stored in this home folder. Now the next folder is the live directory and this is where the binary files are saved and many times you will notice that there are many, many. Sometimes when you install Linux packages, additional libraries are automatically downloaded and they almost always end up somewhere in the live directory and just to put these files or files that are necessary for your program to work on Linux and just to relate it to Windows , you can think of this folder as an equivalent of the program files folder in Windows, but keep in mind that it's not 100 exactly the same and just to explain these other folders that are there, which says live live 32 is basically if you have a 32 bit system. piece of software, this is where the libraries for that are stored as well as the 64 bit system software which is where those library files are also stored and then there is a x32 lib which also contains library files and now the directory media, which is the In the next directory, I'm going to skip the lost and found, which is just a typical folder that's on the aext4 partition, but the media directory is basically another place where external devices, like USB drives, Every time you plug them in, they will appear. there or you can mount them there and it all depends on the Linux distribution, sometimes you may not even see that media directory, you will see a mount directory, which is the next one I want to show you and this is basically a placeholder. folder used to mount folders or drives and this is where I normally mount external drives or remote drives on my operating system and as I said it is simply a placeholder and many times I will create multiple folders underneath depending on where I am connecting, let's say I am connecting connecting to a shared drive or I want to mount a shared drive on another server that is within my network and I always wanted to be in that location.
I'll create a folder for it and give it a name like the server name or something or the share name and then I'll set where that shared drive is mounted to that location whenever the system boots now next time. The folder is the opt directory and this is for optional software for the system and that's the easiest way to say it and I've never used the app directory for anything but it all depends on the distribution you're using also now the prod directory en An important directory is also the processes folder where a lot of system information is represented as files and basically provides a way for the Linux kernel to send and receive information from various processes running in the Linux environment.
Now the next directory is the root. directory and this is different from the actual root location this is basically the home directory for the root account you know like if we had the home folder and then josh where there is a built in user called root who has full permissions to almost everything in the system with ubuntu has this account disabled by default, but it has its own home directory, so if you have ever logged into that root account, which I don't recommend, this is where the files for the root directory are stored, so if you download something, uh by default it will be the root directory while you are running as root user.
Now the next directory is the run directory and this is where many drives are automatically mounted when you want to plug in a USB drive and this is something that is really only relevant for desktop environments so if you have a desktop environment installed many times , they will have the run directory under your path where many of those drives that are automatically mounted on the system will appear running and you can unmount them from that location and let's say you want to mount them in the mount directory or mt directory then you can do it easily, but they put it there for newer, modern Linux distributions, so when you plug in a USB drive, it automatically mounts to that location.
I don't normally use it, but it is there for many users who are switching from a different operating system just to make it easier to use. Now the next directory is s bin and it is similar to the bin directory except that it is dedicated to certain commands that can only be executed by the root or superuser user and this directory also depends on the distribution. Now the temporary directory is basically where files are temporarily stored and most of the time when it is powered off. the system will delete those files from that directory and in fact I missed one of the directories and that is snap snap is a new way of installing applications by somehow containing the application, uh, using it they call it snap packages and you will see that a lot in ubuntu systems, but this is where the us directory is now stored or basically contains files and utilities that are shared between users, that's why I call it i just said usr, but normally I call it user directory, that's just what they are just utilities that are shared between users and then the var directory is basically where the variable data is kept and it's usually system logs, but it can also include other types of data, like if you're running this as a server. the default location for apache is var and then there's a folder underneath it called www and then html so that's where it's actually stored as force files and then they also have log files in there, like if you're running a server and had an Apache. server configuration you will typically see your war log files and there is a directory called log and then also in the root directory you will see a swap file depending on if you have swap on the system and usually if you install it without doing any changes or modifications to the way the system is configured it just takes the default values ​​when you install then normally you will have a swap file and this is just an extra place to store things that are stored in memory that have no It's been accessed for a while, so let's say you have a browser open, but then you go and start working on something else and you finally get to the point where it needs to store, your system needs to store some information that you have open.
You're not currently using it right, sometimes it writes it to the swap file, so that's essentially what it is, but that's pretty much the Linux file structure. I just wanted to cover it this way to make it super simple what I just talked about. each of the directories and you can see them in the system as I go through them, so let's go down and move on to the next section in this next segment. I want to cover some system information commands that you can run now within the Linux terminal. When you have a desktop environment, there are GUI tools that can provide most of the information I'll show you within the command line, but it's a good idea to at least understand how to get this information from the command line and simply show you the gui version of what I'm going to show you from the command line.
I just wanted to open it quickly. Basically you can go to those activities and then you can search here for a system and you should bring. open system monitor and like I said this will give you a lot of information so these are the system processes that are running on the system. This is similar to opening computer management on Windows systems, but you can see your resource information like Well, file system information as well as hard drives and all that good stuff, now I'm going to show you how to view all this information from the command line because all of this information is pulled from some of the folders that I actually showed you. inside the Linux file system and it's just wrapped up in a graphical user interface so you can see it a little bit better, but you can do the exact same thing from the command line, which I'll go down and show you now, so let's go down. and close this and open the terminal and let's zoom in again and sorry I closed it but I need to show you the gui version of the commands that I'm about to show you now let's start with a couple of basic commands like for example I want to show you the uptime so we can type man man up time just to show you, but it basically tells you how long the system has been running, so let's leave that, let's speed up the time and press enter and that's basically the information that it gives you gives you the time that the system has been active, as well as the number of users and the average CPU load, which is part of the information that is entered into that system monitor.
Now the next command I want to show you is the free command and this deals with memory so we can type man and then free and press enter and as you can see it says it shows the amount of free and used memory on the system so we can press q to exit and run free. All I'm going to do is just run the basic command, but it gives you this information for the memory usage on your system and like I said, I just wanted to show you an overview or the basic level of what the command means.
It's used because a lot of these commands are used by system administrators because when you're running a server you don't have a graphical interface, you have to do everything from the command line and I don't want to do this course too. Advanced, I just want to touch on some of these commands because they will definitely help you when you start getting Linux certifications. Now the next command I want to show you is the ps command and this command will show the Linux processes that are currently running. is and it is simply a snapshot so it will not be updated, it will simply include what is currently happening in the Linux operating system in regards to snapshots and the processes of the processors that are running on the system, so I will The first thing I do is let me open the main page for the ps command so you can see that it has a man page as well as a detailed description on how to use it, but the basic way I normally run it is ps and then capital dash, this is the only way I think you should run it and like I said this is just a snapshot of all the processes so let's say you need to close aprocess because occasionally that happens, you need to go in and close a process, well, this is the process.
ID here, uh, that number that shows the ID of the process so they can kill a process if necessary via the command line. I won't show you how to do it, but it's something you may have to do in the future once you become a little more familiar with using the operating system. Now let's get into some hard drive or hard drive commands that I want to show you from the command line and I don't know if you remember, but inside that system monitoring application. We will see that it shows some of the disk information, the partitions and all that.
Let me show you how to find that information from the command line if you need it. The first command I wanted to show you was the df command, so let's go. type man df and basically this reports the disk space usage of the file systems, so let's go down and exit the man page and run the command and we could run it. You have several options, but I'll run it just to show you how. actually use it, but as you can see, it gets a lot of information based on disk space, like for example, this is the partition that housed the root directory and you can tell if it's mounted in mode or mount location, but it's mounted in root so it pretty much keeps the OS there and just to make the information look a little better so you can understand it because it's a little hard to read these things in bytes, well there is an option like I showed you in other commands, but it's h script for human readable and that will basically give you the sizes in a readable format and as you can see it breaks it down right there so you can see the full size is 30 gigabytes and the operating system is taking up about nine gigabytes and you have 21 gigabytes available, so 31 are actually occupied, but this is a lot of great information that you can get about the hard drives and the hard drives and partitions that are connected to your Linux operating system.
Now let's quickly clarify because I want to show you another command and it's called f this, so let's type man f this and press enter and as you can see, you can manipulate these partition tables. This is a great command, but only to get information about the partitions you want to run. the script l option is represented here, so that's the way we're going to run it, that's how I normally pull the information that I'm trying to see about the partitions on the system, so if I type the script l and hit enter , they may not work because you need permissions and this is where the pseudo command really comes into play and I'll still cover that pseudo command in the next segment, but I'll run it so you can see it, but I really want to explain what sudo is. it's actually used for the purpose of the actual program, but sudo and then f this script l and press enter and it should access our user account password or our pseudopassword, so to speak, and this gives you a little bit more information about all partitions. on the system and as you can see here, this is our main hard drive again, a 32 gig vda, uh, and it breaks down all the different partitions as well as the partition types and sizes and all that good information about the drive, now let me of course because I want to show you one more command that I think is beneficial for you to learn or check, but let's type man and then there's another one called ls block and let's press enter and as you can see it lists the blocking devices so let's press q and run the command , so let's go to the ls block and look at the results that actually appear and as you can see, it gives you a little bit more information, but as you can see, it breaks it down a little bit more and shows you the boot locations of almost everything or the mount points you made using the other command, but this is just another command that can help you while you're trying to check the disks that are attached to the system and I know you're probably wondering what are these loopbacks?
Just ignore them. You don't have to worry about that a lot of times, they're just special block devices that are mapped to normal files and show up as a virtual black device, which is essentially what it is now, let me go. Go down and delete again, but now let's put all this information together. I showed them how to observe the processes running on the Linux operating system, as well as CPU load, uptime, and memory information. There are some built-in utilities. which you can use to see all this information just like you would in the GUI version, but it's for the command line, so the first one I wanted to show you is top, so if we run man top this will only give you information about but it basically says which shows Linux processes, but it shows more information than you think, so let's go down and press q and just run above so you can see it and as you can see, it will update just like the processes were updated in the gui, but This is all on the command line, it's a little hard to understand if you don't know what you're looking for, which is why I wanted to include the other one and the way you exit it, just press q and it will take you back to the terminal, but let's clean again and run man h top and I'm 100% sure this app is stored here and it may not have a manual but I'm sure this app is here so let's go down and install it quickly because I want you guys to actually see it because There are some utilities that have been revamped and as you can see, h top has the same word as top.
You know, I'm saying it just has a revamp to make it look a little bit better inside the command line and I can get a little bit more information and it runs pretty much the same as top, okay, so let's install, let's run h top like you can see, it gives you a better representation of what you are really looking for and I recommend it. You install h-top if you don't have it installed on your system, most systems come with h-top installed by default. I'm not sure why Ubuntu decided to remove it but h-top is a very valuable utility that is beneficial when trying to troubleshoot applications so as you can see you can exit using f10 or q and that will exit h top so that concludes This segment shows you how to get information from the systems from the command line, so I'll see you in the next one.
The next command I want to show you deals with networking. Now, if you have a desktop environment, there's probably a network manager in the GUI and I'll just go there so you can see it. but on wired connections you can go to wired settings and this will show the network connections that are in settings and you can review and modify your settings up to the point of setting a static iop address or changing your DNS servers, you know all that . That's cool, you can do it here within a graphical user interface, but I also wanted to show you how to collect that information from the command line by showing you two specific commands.
The first is an older command that's been around for a long time, but it's called if config similar to ipconfig on a Windows OS, so I have config, press, let's go to the man page and it looks like it's not a man page and they may have removed this command from the system because I know it is becoming the older version or it is like an older version to see the IP addresses associated with the system, yes, and as you can see, it is not in the system by default, so let's go down and install that as well, so let's install the sudo apps and you will be able to easily install these packages that way, you can use some of these tools that I'm using, you can follow this, I'm just writing the installation of the sudo app and then network tools and I know I haven't covered the software administration part, but I'll talk about that in a moment.
I just wanted to show you these commands that should be in the system by default. It all depends on the distribution you are using because you could probably install a Debian OS and it may or may not have this tool, but I still wanted to show it to you because it is still relevant, it is something that a lot of people still use, but I will show you the version most recent of this command in a couple of seconds. clear the screen and run if config and press all good actually let's go to the manual because now you should have a manual so if config press enter it will open up and basically what it says is configure a network interface so that most of people use it. just like ipconfig just to get the IP information in your system then ifconfig press Enter as you can see it opens network device which is the name of network device in this system.
Yours may have a different name, but it is essentially the exact same thing and as you can see, this is my IP address, as well as the IPv6 address there as well and other basic network information. Now I won't cover all of this, but I just want to at least show you how to collect that. info now the newer version of this command is actually ip and this should be installed by default now uh man ip yes and it says it shows how to manipulate interfaces and tunnels of routing network devices and this is a much more detailed command, there's a lot of options that this command follows and that's why it's overriding ifconfig so let's press q to exit and get out of it and let's clear it up and just run ip and hit enter and that should show you the help, but I wanted to move on, let's go to ipa.
We will extract all the IP information, as you can see, you get basically the same information, this is the device name here, as well as all the IP addresses under it, so ipv4 in ipv6, as well as the other information of your device on this system, and once you learn this command, you can make changes to it, you can set an IP address, a static IP address or you can add more connections to it and force your system to pull another IP address and you can change the way where it writes the route traffic, but a lot of that falls into these sysadmin type roles, but I wanted to at least cover the command so you guys can see how to gather this information if necessary, so within this segment we'll cover the command sudo as well as the software center and the apt package manager, which is what you will use to manage the software now, before we get to the package manager and the software center, I wanted to talk about the pseudo command just so you can clearly understand what actually it is and just to break it down sudo means superuser and is used to access restricted files and operations because by default the Linux operating system restricts access to certain system ports preventing sensitive files from being compromised and What happens when running the pseudocommand temporarily elevates privileges, allowing users to complete sensitive tasks without logging in as root, so the first thing I want to do is run man and sudo that way you can get a little more information about it and Like I said, I always run these man commands so you can see where to get the information for each of these commands, so let's press enter uh sudo and it says x run a command as another user and it's usually used to elevate a user to a status as superuser or as the root user of the system and the easiest way to relate it to a Windows operating system when you want to run something as an administrator, you right click on the application and press run as administrator, now it's actually not like that. a password that you know in Windows, but you have to take that extra step to run things as an administrator.
A message will simply appear asking you if you want to run this application as an administrator, but in Linux it is totally different. You have to type your password every time you want to elevate your privileges, so let's go down and exit and the way I'm going to show you is what I normally use the sudo command for and that is to update your system, now there are multiple ways of updating it, I think In earlier parts of the course I covered how to install packages within the software center, which I'll mention after this just to show you that you actually also use sudo while using the software center, but I wanted to cover that. in the command line how to update the system but before doing that let's run the man command against apt also because most of the applications have a manual and this is the case of application package manager and as you can see it says interface command line and what it is used for is to install and update packages.
Now let's go down and get out. I just wanted to show you, but apps actually stands for advanced package management tool and it basically makes the process of installing and uninstalling Linux software packages easier. An application is usually the package manager for Debian-based distributions, so most Debian-based distributions will have the application's package manager installed and ready for you to use to install packages on the system and, depending on the distribution you are inusing, there are other package managers. there, but like I said, I want to focus on the applications, so now let's use the sudo command and the application command to update our system.
Now the first command I'm going to run is sudo apt update and just say we break down this command first. We are using sudo to elevate our privileges because we can only make changes to the operating system files if we elevate our privileges because a lot of the packages where the binaries and stuff are are in an area that is owned by the root user of the operating system and so We can make changes to it, we have to elevate our privileges to run the command as root, so this is simply what the sudo command is for and then we have applications, which is our package manager and then there is an option called update and it which the update will do simply to break it completely.
Most Linux distributions have repositories where they store licensed software that you can install on the system and the update command basically updates the cache of packages available on your operating system and this is something you want to do because it will let you know if you have updates , so if there is a new package in your repository installed on your system, it will inform you after running the update command, so let's go. running now so you can see what it's going to do and every time you run sudo you have to type your password for your user account unless it times out because I think it's a five minute time period or so once. you authenticate once, if you run the updated sudo apt command again within that five minute period you won't actually get the password again and basically what you do is access all the Ubuntu servers where the packages are stored and it's refreshing that the cache on the system and as you can see we have three packages that can be updated on the system now, so to update our packages there is another command that basically runs sudo apt update, that's how you actually update those packages so you have to use the update option with the app package manager to update the packages because right now it didn't do the update it just told you that you have updates for the actual packages but to update them you have to type update and just To point this out quickly, you can see what's being updated by running applists and then dash dash upgradable which will list the actual packages that are about to be updated before running the update command, so now let's go. download it and run it so you can see a system update and then here it shows you what packages are being updated and right now the Python 3 update manager is being updated.
The update manager is being updated and the update manager core is updating and then it tells you that three updated applications will be installed and it also tells you how much additional space these updates will take up, as you can see, that's not a lot, but let's go down and press enter or you can type y. to yes and that's basically confirming that you want to update these packages and essentially that's it, that's how you update your system and now that we've done that, let me go down and show you the software center, uh, and this will allow you to install applications, I think I showed it off a little bit before, but I didn't go through and install anything, so let's go down and install something here so you can see the sudo command works pretty much the same way, so let's install, which is an image manipulation program and essentially all you have to do is click on it and then there is a button that says install and one interesting thing about this package manager right here it has reviews of the packages from everyone who is using it and you know information about the package actual thing you're installing and all you have to do is hit install and this is basically running it like sudo because it has to authenticate, it's exactly the same as if you were running it inside the command line so let's hit authenticate and then it'll go through the package installation process and at the end of the day this does exactly what you can do inside the terminal and during my first few years learning Linux I forced myself not to use the package manager which I forced.
I myself have to install things from the command line and I recommend you do the same that way, you can get used to updating package installation from the command line because that's the best way to do it, but let's go ahead and wait for let this end. Finish up, this is a pretty decent sized program, so it's going to take a little bit of time to install, but as you can see, it's almost there, it's right at 90 percent, so let's wait a couple more minutes, but I just wanted to show you . Guys, that's the entire process of opening, installing an app and that's it, and if you ever want to delete an app, all you have to do is press delete, so let's go down and close this.
I'm not going to open the package. which I installed but before I continue I want to show you a couple more things you can do quickly with the application package manager. I thought it would be better for you to understand the actual program, but if we type sudo and then applications and Let's say we want to search for a package and you need to know the names, but all you have to do is type sudo app search and then the name of the package. Let's look for the same package that we just installed, so search and We'll look in the repository for the packages menu or the package that we just installed now, it won't limit you too much because a lot of these packages contain, but if you scroll down here you'll see the actual package and maybe It was difficult to search for it, so let's go back to the end and search for something else and press the up arrow and search for a zip program and we all know how to use zip from Windows.
To compress files and folders, you can use the zip package, where there are a ported version of zip on the Linux operating system that you can use to zip and unzip files, so let's go down and look for that and see if it's there and how it can. Look, I think it's a zip tool or a zip tool, not zip, but it should be yeah, here we go zip, it's uh, that's the actual package, so it's a zip file archiver, so it's a way to search for applications, so let's say we want to install that. application, the package name is what is in green at least on Linux OS and as I said other distributions use different package managers so different commands to search for packages but let's say we want to install zip let's go down e let's install it quickly and the command to install it and let me move the mouse out of the way, but it's sudo apps install and then zip and you can press enter and that will install the zip package, as you can see, zip is already installed, it already has the latest version. that's why it didn't do anything because zip is already installed so let's try unzip because sometimes unzip is not here let's try that and see if it works.
Now unzip is there too so anyway this is how you install a package now let's say you want to remove a package and one thing we can remove is the unzip package and all you have to do is type sudo apps and the command to deleting it is just deleting so delete and then zip or actually let's delete the package and just press enter and I'll go through it and delete it and I think you may have installed a snap package so it may not work , so it was not installed through the application through the package manager, sometimes the default version is the snapshot version. and I know I didn't explain that to you guys, but a plugin is essentially a containerized piece of software that you can install.
They call it instant package. It's a new thing they're pushing for package management, but the application is still relevant and it's something you need to learn to use that Linux OS, so let's try to remove the unzip real quick and we can remove that actual application. It should be ready, so the unzipped one will be removed and then we'll just install it again. the system but that extraction was completely removed unzip from the system now let's go down and install back into the system just by running uh sudo apps install unzip so you can see you know something is actually installing and that's it so you can use zip and unzip the package on this system and this is more or less how the package manager is used on a Linux operating system and this will work primarily for Debian based distributions.
If you are using a different distribution, you will have to check the package manager. documentation for that Linux distribution, okay, in this segment I will cover a couple of text editors and it is very beneficial to understand them so that you can make changes within the Linux operating system and I am talking about similar configuration files for various applications within the operating system that you will occasionally have to do, like when you install certain applications, for example an Apache server, then there are configuration files that you have to modify in order for Apache to work properly, so it is beneficial, it is very beneficial to understand how to use a text editor, so I'm going to show you two of the main ones that I recommend that you start learning to master editing within the terminal because if we look around the desktop we can easily look around the desktop and there's what they call text, uh, like I forget, it's called a text editor, yes, and most link distros, if you have a desktop environment, will come with a text editor, it could be like a mouse pad or something and you could easily make changes here, but it's better to understand how to use it from the command line so I wanted to cover it quickly so you can understand it better so the first thing I want to show you is nano and nano is the easiest and simplest to use so let me go down and show you how start using nano and the first thing I want to do is open the main page so you can at least see the information about the actual program and if we look at it you will know that I am saying that the manual has a lot of good information that can help you understand how to actually use it.
Now let's go down and find a file so we can edit it, so let's go to the CD. um and I know in documents and ansible and I think it's uh I think we have uh let's look at a couple of files here that we can edit so lamp uh simple let's go in there and press enter and then let's set this directory quickly and there or Let's try that host file quickly, so actually, let's go through it quickly because I want to see how long it is, which doesn't really matter, it doesn't have to be too long, yeah, that's a good enough file size, so let's go. edit that file so let me clarify it quickly and the easiest way to use nano is to just type nano and then the name of the actual file that was the host host and press enter there we go so let's go to the end.
I want to show you guys that you can easily edit this like this, so let's type uh ubuntu and then let's type 20.04 uh lts, ​​but that's just how you use the text editor. Now let's cover some of the menu options. Now let's say they need it. help, while you're using this, you could just with the up arrow right there on each of these, which is basically the control button, so press Ctrl g and that will open up our help, as you can see. that's the help right there, you can check it out, you know, I'm saying it explains a little bit more and explains those commands at the bottom, now we can just press q and that will take us back to the real point. file itself, but just to cover some of these options, you have the correct output, I think it's right below, um, you have Ctrl or which writes the changes, so for example, let's use that now that we made changes by adding this ubuntu 20.04 lts, so we can control o and that will write our changes to that file name that we're basically going to access are we sure we want to write it to that file uh and that name or we could change the format or we could change the file name if we wanted to make a copy but let's save it as that file so okay it says write it wrote nine lines and it basically overwrote that file and then we've read it so that's uh control or uh control w is where it is and that's beneficial If, say, you search for something in a big, long file or a configuration file which is basically your search and then the control backslash which is actually a search replacement, then you have control k, so let's say we want cut this whole line, everything you have.
What you need to do is be in front of the line and press Ctrl K and that will cut that actual line. Now let's say we want to paste what we just cut. We can control it and it will paste whatever is there. or whatever you cut recently so cool it's actually there cut and paste you know what I'm saying uh so you have your ctrl j to justify uhctrl t to spell and then ctrl c cursor position and then control underscore to go to specific line and one thing that's beneficial for, let's say, you're a programmer or something like that, a lot of times when you're programming an application or a script or something like that, it will throw an error and tell you which line the error is on. so it's beneficial to use it if you're looking for a specific line within the file that was generated by the error while you were compiling whatever script or application you were working on, especially if the file has like a thousand lines or something.
I know it's very beneficial now that it's pretty much the high level overview of the nano text editor, so let's go down and exit it and just to show you how to exit, you can press uh control and then x and then we did that. make some more changes, so it's basically going to ask you if you want to save those changes, so all we have to do is type y for yes and then it will access if we want to write it to that same file name, press enter and that will actually save that file and we can quickly delete it by typing uh cat host, hit enter and I'll trim that file.
We can see that those changes have been saved to that file now, the next text editor. I want to show you that vim now vim doesn't come on ubuntu by default you have to install it so all you have to do is type uh sudo apps install vim and that will install it on your operating system and let's go down and run it again although already I have it installed here, I just want to run it so you can follow along and see how to install the vim text editor, but vim is based on vi or v, I think vi came first and then vim.
It's basically vi on steroids, it's feature rich, you can set up keybinds and all kinds of stuff, using the movie text editor, and a lot of people rant and rave about how great they are, but I'm one of those people who like, I don't know, just doing things, it doesn't matter how they're done, so a lot of times I'll use nano, but I understand how to use vim and I see the power of using them, so cheers. to all the vim users, I definitely like the program, but let's go down and give you a simple use of the vim application and let's quickly clarify and open a file using a movie, so I just open this. readme.nd file there we go and as you can see the navigation is pretty much the same as nano, but the problem or the thing that confuses people when they are first learning, you have to use commands to be able to do it. certain things like, for example, you can't just type right now in the actual program, you know what I'm saying in the text file, you have to put it in what they call insert mode and the way you get insert mode it's just just typing i and then you'll see down at the bottom the insert mode so scroll down and add some changes here so let's type ubuntu 20.0 and then lts boom to exit insert mode all we can do is all we need.
What we do is we just press Exit and that will take us out of insert mode and we can go back to just browsing the file or whatever, but now this is basically stored in memory. You know what I say every time you open an app and make changes. to something that's stored in memory, it hasn't been written to the actual file and that's similar to the nano text editor, plus every time you make changes to the file it's basically changed in memory and then until it actually exits of the application or save the actual changes, then it's actually just in memory and there are commands to save things in them, so I want to show you some of them quickly, to say that we want to write those changes that we made um to do that, everything what you have to do is press the escape button and then type a colon and then w and that will type the actual changes, so let's press enter and as you can see, we made those changes. you at the bottom right is written so those changes that we made or in the actual file now let's verify that we actually saved those changes.
Let me show you how to exit so all you have to do is type a colon and then queue and press Enter and I'll exit the file and then we'll trim that file quickly to read me that way we can see those changes are there and if we look here, you will see ubuntu 20.04. that we can change, you know the file that those changes were saved in, so let's go down, open it again in the movie and let's say we want to make those changes or change, let's say we want to delete that, the end appears, so let's go to the mode insert uh and then we could delete that text from there now let me show you how to get out of it instead of just typing the changes let me show you how to get out of it and save it at exactly the same time so all we have to do is type escape and that will take us out of insert mode and then we just type a colon and then right and q then w and q and that will write the changes and then we'll exit the actual file, so let's press enter and we can Cut it again so you can see it, but if you look here, the lts gone, that's basically how you make changes to the actual file, you just go into insert mode and then you can write those changes or you can exit. and let's save those changes and then let's go back quickly and I just want to show you how to exit without making changes uh and you can just go back to insert mode right there and let's say we want to write lts and then let's say this is a very long file and we start going through it and no we remember all the edits or changes we made inside this file, so let's say we don't want to save any changes we actually made. this file, so all we have to do is type a colon or exit internal mode first, then control, I mean, then press colon and q and then press o exclamation point and press enter and I'll actually exit without saving those changes and we can crop it again just to make sure, but the changes we made were not saved to the actual file, so there you go, like I said, I just wanted to give you the basics.
I could go really deep into this actual command or this actual text editor, as well as nano, I mean, nano, you know what's amazing? It's also pretty basic, but you know you can get very far with it, but most people had trouble saving and Exiting the actual program, there's a meme that comes up a lot with a joke that basically says how do I get out of them, You know what? What I'm saying is kind of funny or whatever, but I hope these guys help you get started working with text files inside the terminal using a text editor.
This concludes my introductory Linux course. I hope you have learned at least the basics of using Linux. Linux operating system because I think this will motivate you to want to learn more and throughout my years of working in the IT field I have always heard people say that learning Linux is too confusing and I hope this course dispels that myth, so make sure to continue. practicing because the way to become a guru is to keep using Linux, so I hope you have a good day and stay technical.

If you have any copyright issue, please Contact