diff --git a/README.md b/README.md index f29e176..c82287d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,52 @@ -# linux-basics-course +# The Linux Basics Course + +These are notes from the [Linux Basics Course](https://bit.ly/3gGnxm0) hosted on KodeKloud. + +# Table of Contents + +- [01-Introduction](docs/01-Introduction) + +- [02-Working-With-Shell-Part-I](docs/02-Working-With-Shell-Part-I) + + - [01-Introduction-to-Shell](docs/02-Working-With-Shell-Part-I/01-Introduction-to-Shell.md) + - [02-Basic-Commands](docs/02-Working-With-Shell-Part-I/02-Basic-Commands.md) + - [03-Command-Line-Help](docs/02-Working-With-Shell-Part-I/03-Command-Line-Help.md) + - [04-Lab-Working-With-Shell](docs/02-Working-With-Shell-Part-I/04-lab-working-with-shell.md) + - [05-Bash-Shell](docs/02-Working-With-Shell-Part-I/05-Bash-Shell.md) + - [06-Lab-Linux-Bash-Shell](docs/02-Working-With-Shell-Part-I/06-Lab-Linux-Bash-Shell.md) + +- [03-Linux-Core-Concepts](docs/03-Linux-Core-Concepts) + + - [01-Bobs-First-Team-Meeting](docs/03-Linux-Core-Concepts/01-Bobs-first-team-meeting.md) + - [02-The-Linux-Kernel](docs/03-Linux-Core-Concepts/02-The-Linux-Kernel.md) + - [03-Working-With-Hardware](docs/03-Linux-Core-Concepts/03-Working-with-hardware.md) + - [04-Lab-Linux-Kernel](docs/03-Linux-Core-Concepts/04-Lab-Linux-Kernel.md) + - [05-Linux-Boot-Sequence](docs/03-Linux-Core-Concepts/05-Linux-Boot-Sequence.md) + - [06-Run-Levels](docs/03-Linux-Core-Concepts/06-Run-Levels.md) + - [07-File-Types](docs/03-Linux-Core-Concepts/07-File-Types.md) + - [08-Filesystem-Hierarchy](docs/03-Linux-Core-Concepts/08-Filesystem-Hierarchy.md) + - [09-Lab-Linux-RunLevels-Filesystem-Hierarchy](docs/03-Linux-Core-Concepts/09-Lab-Linux-RunLevels-Filesystem-Hierarchy.md) + + +- [04-Package-Mangement](docs/04-Package-Mangement) + + - [01-Package-Management-Distribution](docs/04-Package-Mangement/01-Package-Management-Distribution.md) + - [02-RPM-and-YUM](docs/04-Package-Mangement/02-RPM-and-YUM.md) + - [03-Lab-RPM-and-YUM](docs/04-Package-Mangement/03-Lab-RPM-and-YUM.md) + - [04-DPKG-AND-APT](docs/04-Package-Mangement/04-DPKG-AND-APT.md) + - [05-APT-vs-APT-GET](docs/04-Package-Mangement/05-APT-vs-APT-GET.md) + - [06-Lab-DPKG-AND-APT](docs/04-Package-Mangement/06-Lab-DPKG-AND-APT.md) + + +- [05-Working-With-Shell-Part-II](docs/05-Working-With-Shell-Part-II) + + - [01-Behind-Schedule(story)](docs/05-Working-With-Shell-Part-II/01-Behind-Schedule(story).md) + - [02-File-Compression-and-Archival](docs/05-Working-With-Shell-Part-II/02-File-Compression-and-Archival.md) + - [03-Searching-For-Files-and-Patterns](docs/05-Working-With-Shell-Part-II/03-Searching-for-files-and-patterns.md) + - [04-IO-Redirection](docs/05-Working-With-Shell-Part-II/04-IO-Redirection.md) + - [05-Lab-Working-With-Shell-Part-II](docs/05-Working-With-Shell-Part-II/05-Lab-Working-With-Shell-Part-II.md) + - [06-Vi-Editor](docs/05-Working-With-Shell-Part-II/06-Vi-Editor.md) + - [07-Lab-VI-Editor](docs/05-Working-With-Shell-Part-II/07-Lab-VI-Editor.md) - [06-Security-and-File-Permissions](docs/06-Security-and-File-Permissions) diff --git a/docs/01-Introduction/01-Introduction.md b/docs/01-Introduction/01-Introduction.md new file mode 100644 index 0000000..0240d6c --- /dev/null +++ b/docs/01-Introduction/01-Introduction.md @@ -0,0 +1,17 @@ +# Introduction + +### Course Introduction + + - Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080332) + +### WAR (Story) + + - Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080232) + +### Bob's First Day at Work + + - Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080284) + +### Lab Introduction + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17317208) diff --git a/docs/02-Working-With-Shell-Part-I/01-Introduction-to-Shell.md b/docs/02-Working-With-Shell-Part-I/01-Introduction-to-Shell.md new file mode 100644 index 0000000..cb6b17a --- /dev/null +++ b/docs/02-Working-With-Shell-Part-I/01-Introduction-to-Shell.md @@ -0,0 +1,83 @@ +# Working with the shell - I + +### Introduction to Shell + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074335) + +In this section, we will take a look at linux shell in detail. +- We will learn how to use linux commands and understand how to work with files and directories. +- We will also see different ways to get help with linux commands. +- Finally, we will learn about different types of shells used in Linux (particulary focusing on the bash shell) + +#### Linux shell + +![Shell](../../images/Shell.PNG) + +- This command line interface (CLI) will enable you to effectively work on linux laptop/server/virtual machine. +- While the graphical version may see more appealing to the users but can be limited in case of functionality. These is where the Linux command line ccommonly known as **`Linux Shell`** shines. + + #### What is a shell? + + - Linux shell is a program that allows text based interaction between the user and the operating system, this interaction is carried out by typing commands into the interface and receving the response in the same way. + - The Linux shell is a powerful tool with which you can navigate between different locations within the system, however when you login to the shell the very first directory you were take into is your home directory. + +#### The Home Directory + +![The-Home-Directory](../../images/The_Home_Directory.JPG) + +- A user **`michael`** home directory created under **`/home/michael`**, where **`/home`** is a system created home directory that contains the home directories for almost all users in the linux system. +- The name of the home directory is by default identical to the name of the user, hence **`michael's`** home directory is **`/home/michael`**. +- Remember the home directory is unique for each user. Another user called **`allen`** will have a different home directory which by default created under **`/home/allen`**. + + ##### Why do we need a home directoy? + - The home directory allows users to store their personal data in the form of files and directories + - Each user in the system gets their own unique home directory with complete access to it (to be able to save, retreive , delete data). + - Think of it as a dedicated locker assign to you in which you can store or retreive items. + - Other users can't access your files and folders with in your home directory (only you can). + +**Note** : The representation of the home directory is represented as by the `~ (tilde symbol).` + +#### Command Prompt + +- You can configure the command prompt to show whatever you want, such as the **`hostname`** , **`date`** or **`time`**. +- It is currently configured to show the current working directory. The **`~` symbol** here represents the home directory + +#### Command and Arguments + +- To interact with the linux system using the shell, a user has to type in commands +- When a command is run it executes a program to achieve a specific task. + - **`For example`**: The **`echo`** command is used to print a line of text on the screen. + ``` + $ echo + ``` +- An argument acts as an input to command + - **`For example`**: To print a **`hello`** message type **`echo hello`** command. + ``` + $ echo hello + ``` +- There are several commands that can work without an argument too. + - **`For example`**: Type in the command called **`uptime`**, this is used to print information about how long a system has been running for since the last reboot along with the other information (This command doesn't need an argument) + ``` + $ uptime + ``` +- A command can also have options that modify its behaviour in some predetermine way. The option also sometime referred to as a switch or a flag + - **`For example`**: To print a same word `hello` but without a trailing line, use **`echo`** command with **`-n`** flag. + ``` + $ echo -n hello + ``` + +![Command-and-Arguments](../../images/Command-and-Arguments.PNG) + +#### Command Types + +Command types in linux can be generally categorized in two types + 1. Internal or Built-in Commands + - Internal commands are part of the shell itself. It come bundled with it, there are in total about 30 such commands + - **`For example`**: echo, cd, pwd, set e.t.c. + 1. External Commands + - External commands on the other hand are binary programs or scripts which are usually located in distinct files in the system. They either come with pre-install with the distribution package manager or can be created or installed by the user + - **`For Example`**: mv, date, uptime, cp e.t.c. + +To determine a command is internal or external, use **`type`** command + +![Command-Types](../../images/Command-Types.PNG) diff --git a/docs/02-Working-With-Shell-Part-I/02-Basic-Commands.md b/docs/02-Working-With-Shell-Part-I/02-Basic-Commands.md new file mode 100644 index 0000000..8d2f56b --- /dev/null +++ b/docs/02-Working-With-Shell-Part-I/02-Basic-Commands.md @@ -0,0 +1,168 @@ +# Basic Linux Commands + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17309223) + +In this section, we will take a look at basic linux commands +- Specifically related to navigation and creating new files and directories. +- We will do this by completing a simple task using a linux shell. + +#### Our goal is to create a directory structure, the top most directory which is **`/home/michael`** which is already created as it as a home directory but everything else underneath has to be created. + +![mkdir_cd_working_with_shell_I](../../images/mkdir_cd_working_with_shell_I.PNG) + +To print the present working directory. Run **`pwd`** command +``` +$ pwd +``` + +To see the contents of the directory. Run **`ls`** command +``` +$ ls +```` + +To make (or) create a directory. Run **`mkdir`** command +``` +$ mkdir Asia +``` + +To make (or) create multiple directories. Run **`mkdir`** command followed by **` .. `** +``` +$ mkdir Europe Africa America +``` + +To change a directory from the current directory. Run **`cd `** +``` +$ cd Asia +``` + +To recursively created directories. Run **`mkdir -p /`** +``` +$ mkdir -p India/Mumbai +``` + +To go back to one directory up. Run **`cd ..`** +``` +$ cd .. +``` + +To go back directly to a home directory of the current user from any location in the system. Run **`cd`** +``` +$ cd +``` + +#### Lets now look at absolute path and relative path + + + +![Absolute_and_relative_path_working_with_shell_I](../../images/Absolute_and_relative_path_working_with_shell_I.PNG) + + +To change to a directory with absolute path. Run **`cd `** +``` +$ cd /home/michael +``` + +To Change to a directory with relative path. Run **`cd `** +``` +$ cd Asia +``` + +#### Lets now take a look at alternatives to the **`cd`** command + +![pushd_popd](../../images/pushd_popd.PNG) + +Alternative to the **`cd`** is the **`pushd\popd`** command. To change directory using pushd, run **`pushd `** +``` +$ pushd /etc +``` + +You can change to subdirecties under /etc as many times as you wish +``` +$ pushd /var +$ pushd /tmp +$ pwd +/etc/var/tmp +``` + +To return back to origin directoy(say your home directory), use the **`popd`** command +``` +$ popd +``` + +#### Now lets move on to look some more basic commands in linux. To learn these commands we will make use of the same directory structure as before, however now there are some new files and directories added as shown in the diagram. The goal of this task is to make sure the directory structure looks like the below diagram . + +![before_after_commands](../../images/before_after_commands.PNG) + +To move file or directory. Run **`mv `** command +``` +$ mv /home/michael/Europe/Morocco /home/michael/Africa/ (Absolute path) +$ mv Europe/Morocco Africa/ (Relative Path) +``` + +To rename a directory. Run **`mv `** command +``` +$ mv Asia/India/Munbai Asia/India/Mumbai +``` + +To copy a file to a directory. Run **`cp `** command +``` +$ cp Asia/India/Mumbai/City.txt Africa/Egypt/Cairo +``` + +To delete a file from a directory. Run **`rm /path/`** command +``` +$ rm Europe/UK/London/Tottenham.txt +``` + +To copy a directory recursively. Run **`cp -r `** command +``` +$ cp -r Europe/UK Europe/UnitedKingdom +``` + +To print the content of a file. Run **`cat /path/to/`** command +``` +$cat Asia/India/Mumbai/City.txt +``` + +To add a content to a file with cat(redirect) . Run **`cat > /path/to/`** command +``` +$ cat > Africa/Egypt/Cairo/City.txt + Cairo + `Type Ctrl + d from keyboard` +``` + +To create an empty file. Run **`touch /path/to/filename`** command +``` +$ touch /home/michael/Asia/China/Country.txt +``` + +To see the content of a file in a scrollable manner. Run **`more /path/to/filename`** command <-- not recommended for large files +``` +$ more new_file.txt +``` + +To see the content of a file and navigate throught the file. Run **`less /path/to/filename`** command +``` +$ less new_file.txt +``` + +To get the long list of files and directories. Run **`ls -l`** command +``` +$ ls -l +``` + +To list all files including the hidden. Run **`ls -la`** command +``` +$ ls -a +``` + +To list all the files in the order they were modified. Run **`ls -lt`** command +``` +$ ls -lt +``` + +To list all the files form oldest to newest. Run **`ls -ltr`** command +``` +$ ls -ltr +``` + diff --git a/docs/02-Working-With-Shell-Part-I/03-Command-Line-Help.md b/docs/02-Working-With-Shell-Part-I/03-Command-Line-Help.md new file mode 100644 index 0000000..a50bb1e --- /dev/null +++ b/docs/02-Working-With-Shell-Part-I/03-Command-Line-Help.md @@ -0,0 +1,37 @@ +# Using command line to get help + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17309225) + +In this section we will learn how to use **`help`** command to get help in command line +- If you are new to using `linux` or `bash shell` or if you are not sure which command does what, there are few commands in bash that can help get started. +- Lets take a look of those + +First command is **`whatis`** , this command will displays a one line description of a command does. + +**`Syntax: whatis `** + +``` +$ whatis date +``` + +Most of the commands internal or external come bundled with **`man pages`** which provides information about the command in detail (with examples, usecases and with command options) + +**`Syntax: man `** + +``` +$ man date +``` + +Several commands will provide **`-h`** or **`--help`** to provide users with the options and usecases available in a command + +``` +$ date -h +$ date --help +``` + +To search through the man page names and descriptions for instances of the keyword use **`apropos`**. This is useful if you want to look for all commands within the system that contains the specifc keyword. + +**`Syntax: apropos `** +``` +$ apropos modpr +``` diff --git a/docs/02-Working-With-Shell-Part-I/04-lab-working-with-shell.md b/docs/02-Working-With-Shell-Part-I/04-lab-working-with-shell.md new file mode 100644 index 0000000..a98de05 --- /dev/null +++ b/docs/02-Working-With-Shell-Part-I/04-lab-working-with-shell.md @@ -0,0 +1,51 @@ +# Lab - Working with shell + +- Access Hands-On Labs here [Hands-On-Labs](https://kodekloud.com/courses/873064/lectures/17074343) + +1. To check the home directory for a particular user say **`bob`** + ``` + $ grep bob /etc/passwd | cut -d ":" -f6 + ``` +1. To check the home directory for a particular user using built in shell variables + ``` + $ echo $HOME + ``` +1. In the command **`echo Welcome`**, what does the word Welcome represent with respect to the command? + ``` + $ echo Welcome + - Where Welcome is an argument + ``` + +1. To check **`git`** command type + ``` + $ type git + ``` +1. To create a directory + ``` + $ mkdir /home/bob/birds + ``` +1. To create directories recursively + ``` + $ mkdir -p /home/bob/fish/salmon + ``` +1. Create few more directories + ``` + $ mkdir -p /home/bob/mammals/elephant + $ mkdir -p /home/bob/mammals/monkey + $ mkdir /home/bob/birds/eagle + $ mkdir -p /home/bob/reptile/snake + $ mkdir -p /home/bob/reptile/frog + $ mkdir -p /home/bob/amphibian/salamander + ``` +1. To move a directory + ``` + $ mv /home/bob/reptile/frog /home/bob/amphibian + ``` +1. To rename a directory + ``` + $ mv /home/bob/reptile/snake /home/bob/reptile/crocodile + ``` +1. To delete a directory + ``` + $ rm -r /home/bob/reptile + ``` diff --git a/docs/02-Working-With-Shell-Part-I/05-Bash-Shell.md b/docs/02-Working-With-Shell-Part-I/05-Bash-Shell.md new file mode 100644 index 0000000..0a46d0e --- /dev/null +++ b/docs/02-Working-With-Shell-Part-I/05-Bash-Shell.md @@ -0,0 +1,133 @@ +# Bash Shell + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074351) + +## Different types of Shells + +In this section, we will take a look at different types of shells. +- There are different types of shells in linux, some of the popular ones are below + - Bourne Shell (sh) + - C Shell (csh or tsh) + - Korn Shell (ksh) + - Z Shell (zsh) + - Bourne again shell (Bash) + +To check the shell being used. Use the command **`echo $SHELL`** +``` +$ echo $SHELL +``` + +To change the default shell. Use the command chsh, you will be prompted for the password and following that input the name of the new shell. You have to login into new terminal session to see this change though. +``` +$ chsh +``` + +## Bash Shell Features + +1. Bash supports command auto-completion. What this means is bash means to auto-complete commands for you if you type part of it and press the **`tab`** key + + ![bash-auto](../../images/bash-auto.PNG) + + ![bash-auto1](../../images/bash-auto1.PNG) + +1. In Bash we can set custom aliases for the actual commands + ``` + $ date + $ alias dt=date + $ dt + ``` +1. Use the **`history`** command to list the previous run commands that you ran earlier + ``` + $ history + ``` + + ## Bash environment variables + + To print **`SHELL`** environment variable + ``` + $ echo $SHELL + ``` + + To see a list of all environment variables. Run **`env`** from the terminal + ``` + $ env + ``` + + To set an environment variable with in the shell. The value is not carry forward to any other process. + ``` + $ OFFICE=caleston + ``` + + To set an environment variable we can use the **`export`** command. To make the value carry forward to any other process. + ``` + $ export OFFICE=caleston + ``` + + To persistently set an environment variable over subsequent login or a reboot add them to the **`~/.profile`** or **`~/.pam_environment`** in the users home directory. + + ``` + $ echo "export OFFICE=caleston" >> ~/.profile (or) + $ echo "export OFFICE=caleston" >> ~/.pam_environment + ``` + + To check the value of a environment variable called **`LOGNAME`** + ``` + $ echo $LOGNAME + ``` + +## Path Variable + +#### Speaking about the environment variables, when a user issues an external command into the shell, the shell uses path variable to search for these external commands + +To see the directories defined in path variable. Use the command **`echo $PATH`**. +``` +$ echo $PATH +``` + +To check if the location of the command can be identified. Use the **`which`** command + +**`Syntax: which `** + +``` +$ which obs-studio +``` + +To define a command in the **`PATH`** variable. To add we can use the **`export`** command. +``` +$ export PATH=$PATH:/opt/obs/bin +$ which obs-studio +``` + +## Customize Bash Prompt + +Once you login into the shell, the line you see is the bash prompt. + +![bash-prompt](../../images/bash-prompt.PNG) + +It can be customized to see the **`username`** and the **`hostname`** + +![bash-prompt1](../../images/bash-prompt1.PNG) + +#### The bash prompt is set in control by a set of special shell environment variables. The most common of these and the one we will focus on is **`PS1`** variable. + +![bash-prompt2](../../images/bash-prompt2.PNG) + +To see the value assign to **`PS1`**, type **`echo $PS1`** +``` +$ echo $PS1 +``` + +To change the PS1 to only display the word **`ubuntu-server`**. +``` +$ PS1="ubuntu-server" +$ echo $PS1 +``` + +#### To customize further, have a look at the below special character. + +![bash-prompt3](../../images/bash-prompt3.PNG) + +To change the bash prompt to display **`date`**, **`time`**, **`username of the current user`**, the **`hostname`** and the **`current working directory`** +``` +$ PS1="[\d \t \u@\h:\w ] $ " +``` diff --git a/docs/02-Working-With-Shell-Part-I/06-Lab-Linux-Bash-Shell.md b/docs/02-Working-With-Shell-Part-I/06-Lab-Linux-Bash-Shell.md new file mode 100644 index 0000000..2ad19ca --- /dev/null +++ b/docs/02-Working-With-Shell-Part-I/06-Lab-Linux-Bash-Shell.md @@ -0,0 +1,14 @@ +# Lab - Linux Bash Shell + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17074355) + +1. To check the default shell for the current user.Display the shell for the current user but not necessarily the shell that is running at the movement. + ``` + $ echo $SHELL + ``` +1. To change the shell for bob from **`Bash`** to **`Bourne Shell`** + ``` + $ chsh -s /bin/sh bob + ``` + + diff --git a/docs/03-Linux-Core-Concepts/01-Bobs-first-team-meeting.md b/docs/03-Linux-Core-Concepts/01-Bobs-first-team-meeting.md new file mode 100644 index 0000000..f490d7d --- /dev/null +++ b/docs/03-Linux-Core-Concepts/01-Bobs-first-team-meeting.md @@ -0,0 +1,3 @@ +Welcome Bob. + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074358) diff --git a/docs/03-Linux-Core-Concepts/02-The-Linux-Kernel.md b/docs/03-Linux-Core-Concepts/02-The-Linux-Kernel.md new file mode 100644 index 0000000..e375d5b --- /dev/null +++ b/docs/03-Linux-Core-Concepts/02-The-Linux-Kernel.md @@ -0,0 +1,74 @@ +# Linux Core Concepts + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080351) + +In this section, we will take a look at the core concepts of a linux operating system. +- We will start with introduction to the linux kernel. +- We will then learn about the kernel space and user space. + +## Linux Kernel + +#### If you have worked with any operating system, you have run into the term kernel. + +- The Linux kernel is monolithic, this means that the kernel carrries out CPU scheduling, memory management and several operations by itselfs. +- The Linux Kernel is also modular, which means it can extends its capabilities through the use of dynamically loaded kernel modules + + ![linux-kernel](../../images/linux-kernel.PNG) + +#### To understand a kernel in simple terms, let us use an analogy of a **`College Library`**. Here the librarian is equal to Linux Kernel. + +![library](../../images/library.PNG) + +#### The Kernel is responsible for 4 major tasks + +1. Memory Management +1. Process Management +1. Device Drivers +1. System calls and Security + +## Linux Kernel Versions + +#### let us know identify the ways to identify linux kernel versions + +Use **`uname`** command to get the information about the kernel (by itself it doesn't provide much information except that the system uses the **`Linux`** Kernel. +``` +$ uname +``` + +Use the **`uname -r`** or **`uname`** comamnd and option to print the kernel version +``` +$ uname -r +$ uname -a +``` + ![kernel-versions](../../images/kernel-versions.PNG) + +## Kernel and User Space + +#### One of the important functions of the linux kernel is the **`Memory Management`** . We will now see how memory is seperated within the linux kernel + +Memory is divded into two areas. +1. Kernel Space + 1. Kernel Code + 1. kernel Extensions + 1. Device Drivers +1. User Space + 1. C + 1. Java + 1. Python + 1. Ruby e.t.c + 1. Docker Containers + +![memory-management](../../images/memory-management.PNG) + +#### Let us know see how programs running in the `User Space` work + +All user programs function by manipulating data that is stored in memory and on disk. User programs get access to data by making special request to the kernel called **`System Calls`** +- Examples include, allocating memory by using variables or opening a file. + + ![user-space](../../images/user-space.PNG) + +- For example, opening a file such as the **`/etc/os-release`** to see the operating system installed, results in a **`system call`** + + ![user-space1](../../images/user-space1.PNG) + + diff --git a/docs/03-Linux-Core-Concepts/03-Working-with-hardware.md b/docs/03-Linux-Core-Concepts/03-Working-with-hardware.md new file mode 100644 index 0000000..d2bcdf3 --- /dev/null +++ b/docs/03-Linux-Core-Concepts/03-Working-with-hardware.md @@ -0,0 +1,74 @@ +# Working with Hardware + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080373) + +In this section, we will look at how linux works with the hardware resources available to the system and how to make use of kernel modules +- We will look at how linux identifies and manages hardware devices attached to the system +- We will then see ways to list and get detailed information about these devices from the command line. + +Lets take an example of **`USB Disk`** be used in the system. +- As soon as the **`USB device`** is attached to the system a corresponding device driver which is part of the kernel space detects the stage change and generates an event. +- This event which is called **`uevents`** is then sent to the **`User Space`** device manager daemon called **`udev`**. +- The **`udev`** service is then responsible for dynamically creating a device node associated with the newly attached USB drive in the **`/dev/`** filesystem. +- Once the process is complete, the newly attached disk should be visible under **`/dev/`** filesystem. + +![working-with-hardware](../../images/working-with-hardware.PNG) + +Use **`dmesg`** display messages from the area of kernel called **`Ring Buffer`** . When a linux operating system boots up there were numerous messages generated by the kernel that appear on the display screen. These messages also contain logs from the hardware devices that the kernel detects and provide good indication wheather it is able to configure +``` +$ dmesg +$ dmesg | grep -i usb +``` + +The **`udevadm`** is the management utility for udev which queries the database for device information. +``` +$ udevadm info --query=path --name=/dev/sda5 +``` + +The **`udevadm monitor`** listens to the kernel new **`uevents`** upon detecting an event, it prints the details such as the **`device path`** and the **`device name`** on the screen. This command is handy to determine the details of the newly attached or removed device. +``` +$ udevadm monitor +``` + +To list all PCI (Peripheral Component Interconnect) devices that are configured in the system. Examples of PCI devices are **`Ethernet Cards`**, **`RAID Controllers`**, **`Video Cards`** and **`wireless Adaptors`** that directly attached to PCI slots in the motherboard of the computer +``` +$ lspci +``` + ![pci](../../images/pci.PNG) + + +To list information about **`Block Devices`** +``` +$ lsblk +``` + ![block-device](../../images/block-device.PNG) + + +To display detail information about the **`CPU`** such as CPU architecture, cpu op-modes (32 bit, 64 bit) etc. +``` +$ lscpu +``` + +To list available memory in the system. +``` +$ lsmem --summary +``` + +Another alternate command to see the information about the memory. This command will list total used and free memory. +``` +$ free -m +``` + +To extract detail information about the entire hardware information of the machine +``` +$ lshw +``` + +#### To run commands with root privileges. Not every user can run all the commands in the linux system some commands need to be run as the `root` or the `super-user`. Use **`sudo`** followed by ( input the sudo password ). + +``` +$ sudo lshw +``` + + + diff --git a/docs/03-Linux-Core-Concepts/04-Lab-Linux-Kernel.md b/docs/03-Linux-Core-Concepts/04-Lab-Linux-Kernel.md new file mode 100644 index 0000000..7c05c34 --- /dev/null +++ b/docs/03-Linux-Core-Concepts/04-Lab-Linux-Kernel.md @@ -0,0 +1,47 @@ +# Lab - Linux Kernel + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17074365) + +To check the exact kernel version that is running in this system. +``` +$ uname -r +``` + +what is the kernel version in 4.15.0-88-generic? +``` +Look for the first digit. In this case, it is 15 +``` + +What is the major version number of the kernel 4.15.0-88-generic +``` +Look for the second digit after the kernel version separated by a . In this case, it is 15 +``` + +Which command would you run to print the messages generated by the kernel? +``` +Type the command dmesg to see the messages. +$ dmesg +``` + +To list/count all block devices of type disk that are present in the system +``` +Run: lsblk and count the number of disk devices. +$ lsblk +``` + +To check total number of **`physical cores`** in the system. +``` +Run lscpu and multiply the Core(s) per socket with the number of Socket(s): +$ lscpu +``` + +To check total online memory +``` +Run the lsmem command and look for the value of online memory +$ lsmem +``` + + + + + diff --git a/docs/03-Linux-Core-Concepts/05-Linux-Boot-Sequence.md b/docs/03-Linux-Core-Concepts/05-Linux-Boot-Sequence.md new file mode 100644 index 0000000..6d7fd4f --- /dev/null +++ b/docs/03-Linux-Core-Concepts/05-Linux-Boot-Sequence.md @@ -0,0 +1,56 @@ +# Linux Boot Sequence + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074372) + +In this section, we look at the boot process in a simplied manner by dividing it into four broader steps. +- The boot process can be broken down into four stages + 1. BIOS POST + 1. Boot Loader (GRUB2) + 1. Kernel Initialization + 1. INIT Process + + ![boot-sequence](../../images/boot-sequence.PNG) + + #### How to initiate a linux boot process? + - This can be achieved in one of the two ways. + - The first method is to start a linux device which is in a halted or stopped state + - Second method is to reboot or reset a running system + + #### BIOS POST + + - The first stage, called **`BIOS POST`** has very little to do with linux itself. + - **`POST`** Stands for **`Power On Self Test`**. + - In this stage, BIOS runs a POST test, to ensure the hardware components that are attached to the device are functioning correctly, if POST fails the computer may not be operable and the system will not be proceed to next stage of the boot process + + ![BIOS](../../images/BIOS.PNG) + + #### Boot Loader + - The next stage after BIOS POST is **`Boot Loader`** after successful of POST test. + - BIOS loads and executes the boot code from the boot device, which is located in the first sector of the harddisk. In Linux this is located in the **`/boot`** file system. + - The boot loader will provide the user with the boot screen, often with multiple options to boot into. Such as Microsoft windows O.S or Ubuntu 18.04 O.S in an example of a dual boot system. + - Once the selection is made at the boot screen, boot laoder loads the kernel into the memory supplies it with some parameters and handsover the control to kernel + - A popular example of the boot loader is **`GRUB2`** (GRand Unified Bootloader Version 2). Its a primary boot loader now for most of the operating system. + + ![boot-loader](../../images/boot-loader.PNG) + + #### Kernel Initialization + - After the selected kerenl is selected and loads into the memory, it usually decompress and then loads kernel into the memory. + - At this stage, kernel carries out tasks such as initializing hardware and memory management tasks among other things. + - Once it is completely operational , kernel looks for **`INIT Process`** to run. Which sets up the **`User Space`** and the process is needed for the environment. + + ![kernel-initialize](../../images/kernel-initialize.PNG) + + #### INIT Process + + - In most of the current day linux distribution, the **`INIT`** function then calls the **`systemd`** daemon. + - The **`systemd`** is responsible for bringing the linux host to usable state. + - **`systemd`** is responsible for mounting the file systems, starting and managing system services. + - **`systemd`** is the universal standard these days, but not too long ago another initialization process called **`system V (five) init`** was used. It is also called **`Sys5` + - For example these were used in **`RHEL 6`** or **`CentOS 6`** distribution + - Once of the key advantages of using **`systemd`** over **`system V(five) init`** is that it reduces the system startup time by parallelizing the startup of services. + + To check the **`init`** system used run **`ls -l /sbin/init`**, if it is systemd then you will see a pointer to **`/lib/systemd/systemd`** + ``` + $ ls -l /sbin/init + ``` + diff --git a/docs/03-Linux-Core-Concepts/06-Run-Levels.md b/docs/03-Linux-Core-Concepts/06-Run-Levels.md new file mode 100644 index 0000000..8e2768f --- /dev/null +++ b/docs/03-Linux-Core-Concepts/06-Run-Levels.md @@ -0,0 +1,42 @@ +# Run Levels + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074377) + +## Systemd Targets (Run Levels) + +We can setup the server to boot either into graphical mode or non-graphical mode. Linux can run in multiple modes and these modes are set by something called **`runlevel`** +- The operation mode which provide a graphical interface is called **`runlevel 5`** +- The operation mode which provide a non-graphical mode is called **`runlevel 3`** + + ![run-levels](../../images/run-levels.PNG) + +To see the operation mode run in the system. Run the command **`runlevel`** from the terminal +``` +$ runlevel +``` + +During boot, the **`init`** process checks the **`runlevel`**, it make sure that all programs need to get the system operation in that mode are started. + - For example: The **`Graphical User`** mode requires a **`display manager`** service to run for the GUI to work, however this service is not required for the **`non-graphical mode`** + + ![run-levels1](../../images/run-levels1.PNG) + +In the boot process section, we saw that the **`systemd`** is used as the **`init`** process in most new linux distributions suchs as **`Ubuntu 18.04`**. +- In **`systemd`**, runlevels are called as **`targets`**. + - The RunLevel 5 is called as the **`graphical target`** + - The Runlevel 3 is called as the **`multiuser target`** + + ![run-levels2](../../images/run-levels2.PNG) + +#### Now that we are familiar with runlevels in systemd target unit. Lets now take a look at how we change these values from a shell. + +To see the default target, run the command **`systemctl get-default`**. This command looks at the file located at **`/etc/systemd/system/default.target`** +``` +$ systemctl get-default +``` + +To change the default target, we can make use of **`systemctl set-target `** +``` +$ systemctl set-default multi-user.target +``` + + diff --git a/docs/03-Linux-Core-Concepts/07-File-Types.md b/docs/03-Linux-Core-Concepts/07-File-Types.md new file mode 100644 index 0000000..0c5a2e2 --- /dev/null +++ b/docs/03-Linux-Core-Concepts/07-File-Types.md @@ -0,0 +1,51 @@ +# File Types in Linux + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074379) + +In this section, we will take a look at different types of files in linux. +- Everything is a file in Linux. + - Every object in linux can be considered to be a type of file, even a directory for example is a special type of file. + +There are three types of files. +1. Regular File +1. Directory +1. Special Files + +![file-types](../../images/file-types.PNG) + +**`Special files`** are again catagorized into five other file types. +1. Character Files + - These files represent devices under the **`/dev`** file system. + - Examples include the devices such as the **`keyboard`** and **`mouse`**. +1. Block Files + - These files represent block devices also located under **`/dev/`** file system. + - Examples include the **`harddisks`** and **`RAM`** +1. Links + - Links in linux is a way to associate two or more file names to the same set of file data. + - There are two types of links + - The Hard Link + - The Soft Link +1. Sockets + - A sockets is a special file that enables the communication between two processes. +1. Named Pipes + - The Named Pipes is a special type of file that allows connecting one process as an input to another + + ![file-types1](../../images/file-types1.PNG) + +#### Let us now see how to identify different file types in Linux. + +One way to identify a file type is by making use of the **`file`** command. +``` +$ file /home/michael +$ flle bash-script.sh +$ file insync1000.sock +$ file /home/michael/bash-script +``` + +Another way to identify a file type is by making use of the **`ls -ld`** command +``` +ls -ld /home/michael +ls -l basg-script.sh +``` + ![file-types2](../../images/file-types2.PNG) + diff --git a/docs/03-Linux-Core-Concepts/08-Filesystem-Hierarchy.md b/docs/03-Linux-Core-Concepts/08-Filesystem-Hierarchy.md new file mode 100644 index 0000000..9b8e9ca --- /dev/null +++ b/docs/03-Linux-Core-Concepts/08-Filesystem-Hierarchy.md @@ -0,0 +1,26 @@ +# Filesystem Hierarchy + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074387) + +In this section, lets take a look at the **`filesystem hierarchy`** +- Linux uses single rooted, inverted tree like file system + - **`/home`** : It is the location that contains the home directories for all users, except the **`root`** user (root user home directory is located at **`/root`**) + - **`/opt`** : If you want to install any third party programs put them in the **`/opt`** filesystem. + - **`/mnt`** : It is the default mount point for any partition and it is empty by default. It is used to mount filesystems temporarly in the system + - **`/tmp`** : It is used to store temporary data + - **`/media`** : All external media is mounted on **`/media`** + - **`/dev`** : Contains the special block and character device files + - **`/bin`** : The basic programs such as binaries **`cp`**, **`mv`**, **`mkdir`** are located in the **`/bin`** directory + - **`/etc`** : It stores most of the configuration files in Linux. + - **`/lib`** : The directory **`/lib`** and **`/lib64`** is the place to look for shared libraries to be imported into your program + - **`/usr`** : In older systems, **`/usr`** directory is used for **`User Home Directories`**, however in the modern linux operating systems it is the location where all user land applciations in their data reside + - **`/var`** : It contains variable data like mails, log files + + ![filesystem](../../images/filesystem.PNG) + + To print all the mounted filesystems, run **`df`** (disk filesystem) command + ``` + $ df -hP + ``` + + diff --git a/docs/03-Linux-Core-Concepts/09-Lab-Linux-RunLevels-Filesystem-Hierarchy.md b/docs/03-Linux-Core-Concepts/09-Lab-Linux-RunLevels-Filesystem-Hierarchy.md new file mode 100644 index 0000000..3286bcf --- /dev/null +++ b/docs/03-Linux-Core-Concepts/09-Lab-Linux-RunLevels-Filesystem-Hierarchy.md @@ -0,0 +1,54 @@ +# Lab - Linux Runlevels and Filesystem Hierarchy + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17074394) + +To run commands that need **`sudo`**(super-user) privilages. Run **`sudo`** +``` +$ sudo ls /root +``` + +To check the **`init process`** (systemd or sysV) used by the system +``` +$ sudo ls -l /sbin/init +``` + +To check **`default systemd target`** (eg. graphical.target or multi-user.target) set in the system +``` +$ sudo systemctl get-default +``` + +To change the systemd target to **`multi-user.target`** +``` +$ sudo systemctl set-default multi-user.target +``` + +To check what type of file is **`firefox.deb`** which is located at /root +``` +$ sudo file /root/firefox.deb +``` + +To check what type of file is **`sample_script.sh`** which is located at /root +``` +$ sudo file /root/sample_script.sh +``` + +You were asked to install a new **`third-party IDE`** in the system. Which directory is the recommended choice for the installation? +``` +Third-party software is usually installed under **`/opt`** +``` + +Which directory contains the files related to the block devices that can be seen when running the **`lsblk`** command? +``` +Block Device or Device Node files are located under **`/dev`** directory +``` + +What is the name of the **`vendor`** for the **`Ethernet Controller`** used in this system? +``` +Use: sudo lshw and lookup the vendor for Ethernet Controller under the network section. + $ sudo lshw +``` + + + + + diff --git a/docs/04-Package-Mangement/01-Package-Management-Distribution.md b/docs/04-Package-Mangement/01-Package-Management-Distribution.md new file mode 100644 index 0000000..4cd9c0e --- /dev/null +++ b/docs/04-Package-Mangement/01-Package-Management-Distribution.md @@ -0,0 +1,52 @@ +# Package Management Distribution + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074407) + +In this section, we will take a look at the Linux Package Management tools used in different linux distribution +- Will start with introduction to the package management. + +## Introduction to Package Managers + +For **`Debain/Ubuntu`**, it is **`apt/dpkg`** and for CentOs/Redhat, it is **`RPM`** + +![package-managers](../../images/package-managers.PNG) + +**Question** : What is the difference between **`CentOS`**, **`RHEL`** and **`Ubuntu`***? +- There are hundreds of Linux distributions in use today + +One of the common ways to catagorize linux distribution is by the package manager it uses. +- For example: Distributions such as **`RHEL`**, **`Fedora`** and **`CentOS`**. are based on RPM. Hence they are known as **`RPM`** based distribution. The **`Debian`** family including **`Ubuntu`**, **`Debian`** and **`Linux Mint`** e.t.c. make use of **`Debian`** based package managers such as the **`DPKG`**. + +![deb-rpm](../../images/deb-rpm.PNG) + +#### Now, Lets compare **`RHEL`** and **`CentOS`** Operating Systems. + +![rhel-centos](../../images/rhel-centos.PNG) + +#### What is a package? +- A package in its simplest defination is a compressed archieve that contains all the files that are required by a particular software to run. +- For example: Lets consider an Ubuntu System, we want to install a simple editing system such as **`gimp`** which stands for **` GNU Image Manipulation System`**. To do this, we can make use of the **`gimp.deb`** package which contains all the software binaries and files needed to for the image editor to run along with the metadata which provides the information about the software itself. + +![package](../../images/package.PNG) + +#### Thats seems to be a quite easy process, why don't we do all the time? download a package and install it on a linux servers. Wondering the need of package managers? +- There are hundreds of linux distributions are there, these distributions runs different sets of tools and libraries, software and possibly even different linux kernels as a result of this a linux program may not run the same way from one system to another. To fix this problem packages include a manifest of dependencies or list of programs in versions that must be satified for the package software to run correctly on a given computer. +- Take a look at the errors in the installation while attempting to install **`gimp.deb`** on this ubuntu 18.04 system, the dependencies failed as a result the installations failed. Bare in mind that each of these dependent packages may have dependencies of their own which makes package installation management a very tedious process. This is where a **`Package Manager`** comes into save the day. + + ![package-errors](../../images/package-errors.PNG) + +#### A package manager is a software in a linux system that provides the consistent and automated process in installing, upgrading, configuring and removing packages from the operating system. + +![pkg-mgr](../../images/pkg-mgr.PNG) + +## Functions of Package Manager + +![functions-of-pkg](../../images/functions-of-pkg.PNG) + +## Types of Package Managers + +A Linux distribution supports different types of package managers, some of the common ones are below + +![types-of-pkg](../../images/types-of-pkg.PNG) + + diff --git a/docs/04-Package-Mangement/02-RPM-and-YUM.md b/docs/04-Package-Mangement/02-RPM-and-YUM.md new file mode 100644 index 0000000..f9eaa39 --- /dev/null +++ b/docs/04-Package-Mangement/02-RPM-and-YUM.md @@ -0,0 +1,101 @@ +# RPM and YUM Package Managers + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074421) + +In this section, we will take a look at **`RPM`** and **`YUM`** package managers in detail. +- RPM +- YUM + +## RPM (Redhat Package Manager) + +This package manager is used in RHEL as well as other linux distributions but these are the most common ones. The File extensions for packages manage by RPM is **`.RPM`** + +![rpm](../../images/rpm.PNG) + +#### Working with RPM + +RPM has five basic modes of operations. Each of these modes can be run using **`rpm`** command followed by a specific command **`options`**. Despite of this, RPM doesn't resolve dependencies on its own. This is why we make use of a higher level of package manager called **`YUM`**. +1. Installing +1. Uninstalling +1. Upgrade +1. Query +1. Verfiying + + ![rpm-modes](../../images/rpm-modes.PNG) + +## YUM (Yellowdog Updater Modifier) + +YUM is a free and opensource package manager. +- Works on RPM based Linux systems +- Works with Software repositories which are essentially a collection of packages and provides package independency management on RPM based distro. The repository information is stored in **`/etc/yum.repos.d/`** and repository files will have the **`.repo`** extension. +- Acts as a high level package manager but under the hood it still depeneds on **`RPM`** to manage packages on the linux systems. +- Unlike RPM, YUM handles package dependencies very well (Automatic Dependency Resolution). It is able to install any dependencies packages to get the base package install on the linux system. + + ![yum](../../images/yum.PNG) + +#### Let us see how YUM installs a package. + +![yum-repo](../../images/yum-repo.PNG) + +#### Now, lets take a look at sequence of steps envolve while installing the package. +- Once yum runs **`yum install`** command is issued YUM first runs transaction check, if the package is not installed in the system yum checks the configured repositories under **`/etc/yum.repos.d/`** for the availability of the requested package. +- It also checks if there are any dependent packages are already installed in the system or if it needs to be upgrade. + + ![yum-cmd](../../images/yum-cmd.PNG) + +- After this step, transaction summary is displayed on the screen for the user to review, if we wish to proceed with the install enter the **`y`** button (this step can be skipped by providing the **`-y`** flag with the **`yum install`** command). +- Yum will download and install necessary RPMs to linux system + + ![yum-cmd1](../../images/yum-cmd1.PNG) + + +If you want to update a single package, use **`yum update`** command. If the package is already in the latest version in the repository and hence no action will be taken + +![yum-update](../../images/yum-update.PNG) + + +#### Common Commands + +To list all the repos added to your system. Run **`yum repolist`** +``` +$ yum repolist +``` + +To check which package should be installed for specific command to work. Use **`yum provides`** command followed by name. +``` +$ yum provides scp +``` + +To Install a package +``` +$ yum install httpd +``` + +To Install a package to automatically answer "yes" to any question prompt during the operation. Use **`-y`** flag with the **`yum install`** command. +``` +$ yum install httpd -y +``` + +To remove a package +``` +$ yum remove httpd +``` + +To update a package +``` +$ yum update telnet +``` + +To update all packages in the system, use the **`yum update`** command without any arguments. +``` +$ yum update +``` + + + + + + + + + diff --git a/docs/04-Package-Mangement/03-Lab-RPM-and-YUM.md b/docs/04-Package-Mangement/03-Lab-RPM-and-YUM.md new file mode 100644 index 0000000..6ea7085 --- /dev/null +++ b/docs/04-Package-Mangement/03-Lab-RPM-and-YUM.md @@ -0,0 +1,35 @@ +# Lab - RPM and YUM + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17080533) + +Which package managers would you use on centos machine +``` +Centos makes use of RPM and YUM +``` + +Use an **`rpm`** command and find out the exact package name for **`wget`** installed in this server +``` +$ rpm -qa |grep wget +``` + +To install a package for **`firefox`** browser that has been downloaded under **`/home/bob`** in the system. Caution: It might fail due to failed dependencies +``` +$ sudo rpm -ivh /home/bob/firefox-68.6.0-1.el7.centos.x86_64.rpm +``` + +To install a package for **`firefox`** browser along with its dependencies +``` +$ sudo yum install firefox -y +``` + +To check how many software repositories are configured for YUM in the system +``` +$ sudo yum repolist +``` + +To check which package provides **`tcpdump`** command +``` +$ sudo yum provides tcpdump +``` + + diff --git a/docs/04-Package-Mangement/04-DPKG-AND-APT.md b/docs/04-Package-Mangement/04-DPKG-AND-APT.md new file mode 100644 index 0000000..4a64928 --- /dev/null +++ b/docs/04-Package-Mangement/04-DPKG-AND-APT.md @@ -0,0 +1,86 @@ +# DPKG and APT Package Managers + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074424) + +In this section, we will look at debian package managers for distributions like **`Ubuntu`**, **`Debian`** and **`PureOS`**. +- DPKG +- APT + +## DPKG Utility + +- DPKG stands for Debian Package Manager +- It is a low level package manager + +![dpkg](../../images/dpkg.PNG) + +#### Working with DPKG + +Similar to RPM, DPKG can be used for the below. The package extension is .deb. +1. Installing +1. Uninstalling +1. Upgrade +1. List +1. Status +1. Verfiying + + ![dpkg-modes](../../images/dpkg-modes.PNG) + +## APT and APT-GET + +Similar to RPM, DPKG doesnt resolve the dependencies when it comes to package management. +- Install may fail due to dependencies issues. This is the reason why we use higher level debian package managers such as **`APT`** and **`APT-GET`**. + + ![dpkg-fail](../../images/dpkg-fail.PNG) + +- Instead of relying on DPKG, you can install software along with its dependencies using **`APT`** or **`APT-GET`**. +- **`APT`** or **`APT-GET`** although sounds similar, but they do not depend on each other. +- **`APT`** stands for advanced package managers, it is more user friendly and overall better tool compared to **`APT-GET`**. + ``` + $sudo apt install gimp + $sudo apt-get install gimp + ``` + +- APT act as a frontend package manager that relies on DPKG utility. In similar to YUM, APT relies on software repository that contains packages that would eventually be installed on a system. +- The software repository for APT is defined in **`/etc/apt/sources.list`** file. + + ![apt](../../images/apt.PNG) + +#### Let us know see some common commands + +To refresh a repository. Run **`apt update`** command. +``` +$ sudo apt update +``` + +To install available upgrades of all packages currently installed on the system from the sources configured. +``` +$ sudo apt upgrade +``` + +Another way to update the repository is to use **`apt edit-sources`** command. This opens up the **`/etc/apt/sources.list`** file in the text editor of your choice. +``` +$ sudo apt edit-sources +``` + +To install the package +``` +$ sudo apt install telnet +``` + +To remove the package +``` +$ sudo apt remove telnet +``` + +To search or look for a package in the repository. +``` +$ sudo apt search telnet +``` + +To list all the available packages +``` +$ sudo apt list |grep telnet +``` + + + diff --git a/docs/04-Package-Mangement/05-APT-vs-APT-GET.md b/docs/04-Package-Mangement/05-APT-vs-APT-GET.md new file mode 100644 index 0000000..c84ee52 --- /dev/null +++ b/docs/04-Package-Mangement/05-APT-vs-APT-GET.md @@ -0,0 +1,23 @@ +# APT vs APT-GET + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17074428) + +#### Difference between APT vs APT-GET +- APT is a more user friendly tool when compared to APT-GET +- In all the latest debian based distros APT is already installed by default. + +#### Lets take a look why **`APT`** is better when compare to **`APT-GET`** + +Lets try to install **`firefox`** package using both APT and APT-GET +- You will notice APT does easy on the eyes, you get just enough information and also a nice little progress bar +- APT-GET is just effective and doesn't provide the output in user-friendly format. + + ![apt-vs-apt-get](../../images/apt-vs-apt-get.PNG) + +Lets try another comparision by search a **`telent`** package. +- You will notice with apt, all its options are located in one place. You can search with **`apt search telnet`** command. +- On the other hand, you cannot use search command with **`apt-get`** command. Instead, you have to use another tool called **`apt-cache search telnet`**. +- If you compare the results of the two commands, you will also see the **`apt-cache`** throws in a lot of extra information in the search result, which may not be really useful for the end user. + + ![apt-vs-apt-get1](../../images/apt-vs-apt-get1.PNG) + diff --git a/docs/04-Package-Mangement/06-Lab-DPKG-AND-APT.md b/docs/04-Package-Mangement/06-Lab-DPKG-AND-APT.md new file mode 100644 index 0000000..8cb34a9 --- /dev/null +++ b/docs/04-Package-Mangement/06-Lab-DPKG-AND-APT.md @@ -0,0 +1,33 @@ +# Lab - DPKG and APT + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17074429) + +Package managers that you use on a debian based distro +``` +Debain distros use dpkg. +``` + +To install a package for **`firefox`** browser which has been downloaded at /root/firefox.deb. The dependencies might fail. +``` +$ sudo dpkg -i /root/firefox.deb +``` + +To install a package using **`APT`** +``` +$ sudo apt install firefox +``` + +Lets now locate the package to install Chromium browser in the system. Use **`apt search`** functionality to locate the correct package name. The browser has the description of: Chromium web browser, open-source version of Chrome +``` +$ sudo apt search chromium-browser +``` + +To install the **`chromium-browser`** +``` +sudo apt install -y chromium-browser +``` + +To remove the **`firefox`** browser from the system. +``` +$ sudo apt remove firefox +``` diff --git a/docs/05-Working-With-Shell-Part-II/01-Behind-Schedule(story).md b/docs/05-Working-With-Shell-Part-II/01-Behind-Schedule(story).md new file mode 100644 index 0000000..c9931a0 --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/01-Behind-Schedule(story).md @@ -0,0 +1,3 @@ +# Behind Schedule (Story) + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080747) diff --git a/docs/05-Working-With-Shell-Part-II/02-File-Compression-and-Archival.md b/docs/05-Working-With-Shell-Part-II/02-File-Compression-and-Archival.md new file mode 100644 index 0000000..2d28f49 --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/02-File-Compression-and-Archival.md @@ -0,0 +1,92 @@ +# File Compression and Archival + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080556) + +In this section, we will take a look to compress and archive files +- File Compression and Archival + +## Viewing file sizes + +The **`du`** command, which stands for **`disk usage`** is a popular command to inspect the size of the file. +- **`du`** with **`-sk`** shows the size of a file or directory in **`Kilobytes`** + ``` + $ du -sk test.img + ``` + +- **`du`** with **`-sh`** shows the size of a file or directory in **`human readable format`** + ``` + $ du -sh test.img + ``` + +- we can also use **`long list`** , **`ls -lh`** to print the size of the file. + ``` + $ ls -lh test.img + ``` + +## Archiving Files + +Let us know take a look at widely used utility called **`tar`** +- **`tar`** is used to group multiple files and directories into a single file. Hence it is specially used for archiving data. +- tar is an abrevation for **`tape archive`**. +- Files created with tar are often called **`tarballs`**. + +To archive a file or directory. Use **`tar`** command followed by **`-c`** to create an archive and the **`-f`** is used to specify the name of the tar file to be created. These is followed by files or directories to be archive. +``` +$ tar -cf test.tar file1 file2 file3 +$ ls -ltr test.tar +``` + +The **`tar`** command followed by **`-tf`** option followed by the tar filename is used to see the contents of the tarball. +``` +$ tar -tf test.tar +``` + +The **`tar`** command followed by **`-xf`** option followed by the tar filename is used to extract the contents from the tarball. +``` +$ tar -xf test.tar +``` + +The **`tar`** command followed by **`-zcf`** option is used to compress the tarball to reduce its size. +``` +$ tar -zcf test.tar +``` + +## Compression + +Compression is the technique used to reduce the size consumed by a file or a dataset. +- To reduce the size of a file or directory in the linux file system, there are commands specificly used for compression. +- Let us now look at the three popular ones + - bzip2 (.bz2 extension) + - gzip (.gz extension) + - xz (.xz extension) + + ``` + $ bzip2 test.img + $ gzip test1.img + $ xz test2.img + ``` + +#### The space of the compressed files created by these three commands depends on a few factors, such as the type of data being compressed, the other factors that effect the size are the compression algorithm used by these commands and the compression level used. + +- The compressed files can be uncompressed by using the below commands + - bunzip2 + - gunzip + - unxz + ``` + $ bunzip2 test.img + $ gunzip test1.img + $ unxz test2.img + ``` + + ![compress-uncompress](../../images/compress-uncompress.PNG) + +#### Compressed files need not to be uncompressed everytime +- Tools such as **`zcat`** , **`bzcat`** and **`xzcat`** allow the compressed files to be read without an uncompress + ``` + $ zcat hostfile.txt.bz2 + $ zcat hostfile.txt.gz + $ zcat hostfile.txt.xz + ``` + ![compress-cat](../../images/compress-cat.PNG) + + diff --git a/docs/05-Working-With-Shell-Part-II/03-Searching-for-files-and-patterns.md b/docs/05-Working-With-Shell-Part-II/03-Searching-for-files-and-patterns.md new file mode 100644 index 0000000..cb79a9d --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/03-Searching-for-files-and-patterns.md @@ -0,0 +1,91 @@ +# Searching for files and Patterns + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080595) + +In this section, we will take a look at how to locate a file or directory in the filesystem. +- locate +- find +- grep + +## locate +Lets say you want to find the files with the name **`City.txt`**. Easiest way to do this is to make use of **`locate`** command. +- Run **`locate`** command followed by the filename you are searching as an argument. This should return all paths matching the pattern. + ``` + $ locate City.txt + ``` + +- The downside of the locate command is it depends on a database called **`mlocate.db`** for querying the filename. +- If you have just installed linux or if the file you are trying to locate was created recently. The locate command may not give you useful results. This is because it is possible that the DB is not been updated yet. +- To manually update the DB, run the command **`updatedb`** and then run the locate command again + ``` + $ sudo updatedb + ``` +- Please note that the **`updatedb`** command needs to be run as root user to work. + +## find + +Another way to do this is make use of the **`find`** command. Use the find command followed by the directory under which you want to search. To search file by a name use the **`-name`** option followed by the name of the file. +``` +$ find /home/michael -name City.txt +``` + ![locate-find](../../images/locate-find.PNG) + +## Grep + +To search within files, the most popular command in linux is grep. +- Grep is commonly used to print lines of a file matching a pattern but it also offers a variety of other options as well. +- The grep command is case-sensitive + +To search for the word **`second`** from the **`sample.txt`** +``` +$ grep second sample.txt +``` + +To search for the word **`capital`** with **`case-insensitive`** use **`-i`** flag. +``` +$ grep -i capital sample.txt +``` + +To search for a pattern recursively. +``` +$ grep -r "thrid Line" /home/michael +``` + +To print the lines that don't matches the pattern +``` +$ grep -v "printed" sample.txt +``` + + ![grep](../../images/grep.PNG) + +#### What if you want to match a pattern that form a whole word? + +To search for the whole word called **`exam`**. Use **`grep`** followed by **`-w`** flag +``` +$ grep -w exam examples.txt +``` + +You can also combine multiple options together. For example, to reverse the search and print all lines of the same file that doesn't match the whole word exam. Use **`grep -vw`** +``` +$ grep -vw exam examples.txt +``` + +To print the number of lines after and before matching a pattern. Use **`grep`** command with **`-A`** and **`-B`** flags respectively. +``` +$ grep -A1 Arsenal premier-league-table.txt +$ grep -B1 4 premier-league-table.txt +``` + + ![grep1](../../images/grep1.PNG) + + +Finally, the **`-A`** and **`-B`** can be combined into one single search. +``` +$ grep -A1 -B1 Chelsea premier-league-table.txt +``` + ![grep2](../../images/grep2.PNG) + + + + + diff --git a/docs/05-Working-With-Shell-Part-II/04-IO-Redirection.md b/docs/05-Working-With-Shell-Part-II/04-IO-Redirection.md new file mode 100644 index 0000000..9a20c8e --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/04-IO-Redirection.md @@ -0,0 +1,73 @@ +# IO Redirection + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080597) + +In this section, we will take a look at IO **`Redirection`**. +- IO Redirection +- Standard Streams in Linux + +There are three data streams created when you launch a linux commnad. +- Standard Input (STDIN) + - STDIN is the standard input stream which accepts text as an input. +- Standard Output (STDOUT) + - Text output is delivered as STDOUT or the standard out stream +- Standard ERROR (STDERR) + - Error messages of the command are sent through the standard ERROR stream (STDERR) + + ![io](../../images/io.PNG) + +With IO Redirection, the STDIN, STDOUT and STDERR can be redirected to a text file. + +## REDIRECT STDOUT + +To redirect STDOUT to a file instead of printing it on the screen. +``` +$ echo $SHELL > shell.txt +``` + +To append STDOUT to an exisiting file +``` +$ echo $SHELL >> shell.txt +``` + +## REDIRECT STDERR + +To redirect just the ERROR message we need to use **`2`** followed by forward arrow **`>`** symbol and then the name of the filename in which the errors are written. +``` +$ cat missing_file 2> error.txt +``` + +To append the STDERR to the exisiting file +``` +$ cat missing_file 2>> error.txt +``` + +If you want to execute and not print ERROR messages on the screen even if it generates a standard ERROR. You can redirect to **`/dev/null`** +``` +$ cat missing_file 2> /dev/null +``` + +## Command Line Pipes + +Command Line Pipes allow the linking of multiple commands. +- In simple terms, pipes allows the first commands standard output to be used as the standard input for the second command. +- The pipes are defined using vertical bar symbol (|). + + ``` + $ grep Hello sample.txt | less + ``` + ![pipe](../../images/pipe.PNG) + +Another command to work with STDIN and STDOUT is the **`tee`** command. +- Instead of the redirect operator, we can use the command line pipe **`(|)`** followed by **`tee`** command. + ``` + $ echo $SHELL | tee shell.txt + ``` + + - Use **`tee`** with -a option, to append instead of overwritting it + ``` + $ echo "This is the bash shell" | tee -a + ``` + + ![tee](../../images/tee.PNG) + diff --git a/docs/05-Working-With-Shell-Part-II/05-Lab-Working-With-Shell-Part-II.md b/docs/05-Working-With-Shell-Part-II/05-Lab-Working-With-Shell-Part-II.md new file mode 100644 index 0000000..fecebdb --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/05-Lab-Working-With-Shell-Part-II.md @@ -0,0 +1,46 @@ +# Lab - Working With Shell Part - II + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17080558) + +Create a tarball of the directory called **`python`** and compress it using **`gzip`**. The compressed tar file should be available at **`/home/bob/python.tar.gz`** +``` +$ tar -cf /home/bob/python.tar /home/bob/reptile/snake/python +$ gzip /home/bob/python.tar +``` + +There is a compressed file called eaglet.dat.gz located under the eagle directory. Extract it in the same location +``` +$ gunzip /home/bob/birds/eagle/eaglet.dat.gz +``` + +A file has been copied to the laptop by the name of caleston-code. But he does not remember which directory he saved it in.Can you find it? +``` +$ sudo find / -name caleston-code +``` + +Find the location of the file called **`dummy.service`** and redirect its absolute path to the file **`/home/bob/dummy-service`**. You can use the redirect operator with the echo command to save the answer to the file. +``` +$ sudo find / -name dummy.service +$ echo /etc/systemd/system/dummy.service > /home/bob/dummy-service +``` + +Find the file under **`/etc`** directory that contains the string **`172.16.238.197`**. Save the answer using the absolute path in the file **`/home/bob/ip**` +``` +$ sudo grep -ir 172.16.238.197 /etc/ > /home/bob/ip +``` + +Create a new file called **`/home/bob/file_wth_data.txt`**. This file should have one line of text that says **`a file in my home directory`**. Make use of the redirect operator. +``` +$ echo "a file in my home directory" > /home/bob/file_wth_data.txt +``` + +Run the command python3 **`/home/bob/my_python_test.py`** and redirect the **`standard error`** to the file **`/home/bob/py_error.txt`**. +``` +$ python3 /home/bob/my_python_test.py 2>/home/bob/py_error.txt +``` + +Read the file **`/usr/share/man/man1/tail.1.gz`** and without extracting it copy the first line of this file to **`/home/bob/pipes`** +``` +$ zcat /usr/share/man/man1/tail.1.gz | head -1 > /home/bob/pipes +``` + diff --git a/docs/05-Working-With-Shell-Part-II/06-Vi-Editor.md b/docs/05-Working-With-Shell-Part-II/06-Vi-Editor.md new file mode 100644 index 0000000..d71c89a --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/06-Vi-Editor.md @@ -0,0 +1,56 @@ +# Vi Editor + +- Take me to the [Video Tutorial](https://kodekloud.com/courses/873064/lectures/17080600) + +In this section, we will take a look at console based text editors in linux. +- It is not feasible using **`cat`** when dealing with large amounts of text or for writing code. This is why we use text editors + +## Text Editor + +There are several options available, we will be focusing on the **`VI Editor`**. +- Most popular text editor in linux is the **`VI`** Editor. +- The VI EDITOR is available in all most all of the linux distribution out of the box. +- The command to open the vi editor is **`vi`** followed by the filename that you want to create or append. + ``` + $ vi /home/michael/sample.txt + ``` +- The VI EDITOR has three operation modes. + 1. Command Mode + - When the vi editor opens a file, it always goes to the **`COMMAND MODE`** first. + - In this mode, the editor only understands the commands + 1. Insert Mode + - To switch from command mode to **`INSERT MODE`** type lower case **`i`** + - This mode allows you to write text into the file. + - Once you are done with editing the file, to go back to command mode hit the **`ESC`** button. + - While going into insert mode from command mode you may use other options such as **`I`**, **`o`**, **`O`**, **`a`**, or **`A`** + 1. Last Line Mode + - Pressing the **`:`** key will take you to the **`LAST LINE MODE`** + - In this mode you can choose to save changes to the file, discard changes, or save and edit. + - From the last line mode hit the **`ESC`** key to go back to the command mode. + + ![vi](../../images/vi.PNG) + + ## Command Mode + + ![command1](../../images/command1.PNG) + + ![command2](../../images/command2.PNG) + + ![command3](../../images/command3.PNG) + + + ## Insert Mode + + ![insert](../../images/insert.PNG) + + ## Last Line Mode + + ![lastline](../../images/lastline.PNG) + + + #### There is another popular editor called **`VIM`** which is an improved version of **`VI`** with added features but very similar in appereance to VI. + + - In the most distros today, the VI is the symblic to the VIM editor + + ![VIM](../../images/VIM.PNG) + diff --git a/docs/05-Working-With-Shell-Part-II/07-Lab-VI-Editor.md b/docs/05-Working-With-Shell-Part-II/07-Lab-VI-Editor.md new file mode 100644 index 0000000..34512ea --- /dev/null +++ b/docs/05-Working-With-Shell-Part-II/07-Lab-VI-Editor.md @@ -0,0 +1,44 @@ +# Lab - VI Editor + +- Access Hands-On Labs here [Hands-On Labs](https://kodekloud.com/courses/873064/lectures/17080603) + +Go to **`insert mode`** +``` +Press i +``` + +Exit from **`insert mode`** and go to **`command mode`** +``` +Press ESC +``` + +To **`remove`** a character +``` +Move Cursor to the characters to be removed and press x to remove them +``` + +Change the file contents to **`Welcome to KodeKloud`** and **`save`** file. +``` +Go to insert mode by pressing i and delete all content and type in new content. Once done press ESC key and go to command mode. Then type in command :w! +``` + +Update the port it listens on from **`80`** to **`5000`** in apache webserver. +``` +Go to insert mode by pressing i and replace 80 with 5000 in line 10 +``` + +Remove the line that starts with **`LogFormat`**. +``` +Go to the line 33 and press dd (d twice) to remove the entire line. +``` + +To undo the previous change +``` +Press u to undo previous change +``` + +There's a 6 hiding in the file. Find it. +``` +find command /6 +``` + diff --git a/images/Absolute_and_relative_path_working_with_shell_I.PNG b/images/Absolute_and_relative_path_working_with_shell_I.PNG new file mode 100644 index 0000000..3e481e1 Binary files /dev/null and b/images/Absolute_and_relative_path_working_with_shell_I.PNG differ diff --git a/images/BIOS.PNG b/images/BIOS.PNG new file mode 100644 index 0000000..15cdcc0 Binary files /dev/null and b/images/BIOS.PNG differ diff --git a/images/Command-Types.PNG b/images/Command-Types.PNG new file mode 100644 index 0000000..9bf7d54 Binary files /dev/null and b/images/Command-Types.PNG differ diff --git a/images/Command-and-Arguments.PNG b/images/Command-and-Arguments.PNG new file mode 100644 index 0000000..ebff597 Binary files /dev/null and b/images/Command-and-Arguments.PNG differ diff --git a/images/Readme.md b/images/Readme.md new file mode 100644 index 0000000..3cb458f --- /dev/null +++ b/images/Readme.md @@ -0,0 +1 @@ +Images diff --git a/images/Shell.PNG b/images/Shell.PNG new file mode 100644 index 0000000..14004b7 Binary files /dev/null and b/images/Shell.PNG differ diff --git a/images/The_Home_Directory.JPG b/images/The_Home_Directory.JPG new file mode 100644 index 0000000..e772228 Binary files /dev/null and b/images/The_Home_Directory.JPG differ diff --git a/images/VIM.PNG b/images/VIM.PNG new file mode 100644 index 0000000..2abbd85 Binary files /dev/null and b/images/VIM.PNG differ diff --git a/images/apt-vs-apt-get.PNG b/images/apt-vs-apt-get.PNG new file mode 100644 index 0000000..e9aa45a Binary files /dev/null and b/images/apt-vs-apt-get.PNG differ diff --git a/images/apt-vs-apt-get1.PNG b/images/apt-vs-apt-get1.PNG new file mode 100644 index 0000000..8503b6f Binary files /dev/null and b/images/apt-vs-apt-get1.PNG differ diff --git a/images/apt.PNG b/images/apt.PNG new file mode 100644 index 0000000..4f210ea Binary files /dev/null and b/images/apt.PNG differ diff --git a/images/bash-auto.PNG b/images/bash-auto.PNG new file mode 100644 index 0000000..071adab Binary files /dev/null and b/images/bash-auto.PNG differ diff --git a/images/bash-auto1.PNG b/images/bash-auto1.PNG new file mode 100644 index 0000000..69c8b43 Binary files /dev/null and b/images/bash-auto1.PNG differ diff --git a/images/bash-prompt.PNG b/images/bash-prompt.PNG new file mode 100644 index 0000000..3523b52 Binary files /dev/null and b/images/bash-prompt.PNG differ diff --git a/images/bash-prompt1.PNG b/images/bash-prompt1.PNG new file mode 100644 index 0000000..3251151 Binary files /dev/null and b/images/bash-prompt1.PNG differ diff --git a/images/bash-prompt2.PNG b/images/bash-prompt2.PNG new file mode 100644 index 0000000..008d89d Binary files /dev/null and b/images/bash-prompt2.PNG differ diff --git a/images/bash-prompt3.PNG b/images/bash-prompt3.PNG new file mode 100644 index 0000000..a8252ea Binary files /dev/null and b/images/bash-prompt3.PNG differ diff --git a/images/before_after_commands.PNG b/images/before_after_commands.PNG new file mode 100644 index 0000000..e321914 Binary files /dev/null and b/images/before_after_commands.PNG differ diff --git a/images/block-device.PNG b/images/block-device.PNG new file mode 100644 index 0000000..69a4910 Binary files /dev/null and b/images/block-device.PNG differ diff --git a/images/boot-loader.PNG b/images/boot-loader.PNG new file mode 100644 index 0000000..0f93d6c Binary files /dev/null and b/images/boot-loader.PNG differ diff --git a/images/boot-sequence.PNG b/images/boot-sequence.PNG new file mode 100644 index 0000000..39f1776 Binary files /dev/null and b/images/boot-sequence.PNG differ diff --git a/images/command1.PNG b/images/command1.PNG new file mode 100644 index 0000000..fbcbcc8 Binary files /dev/null and b/images/command1.PNG differ diff --git a/images/command2.PNG b/images/command2.PNG new file mode 100644 index 0000000..9262258 Binary files /dev/null and b/images/command2.PNG differ diff --git a/images/command3.PNG b/images/command3.PNG new file mode 100644 index 0000000..881c347 Binary files /dev/null and b/images/command3.PNG differ diff --git a/images/compress-cat.PNG b/images/compress-cat.PNG new file mode 100644 index 0000000..d23fcae Binary files /dev/null and b/images/compress-cat.PNG differ diff --git a/images/compress-uncompress.PNG b/images/compress-uncompress.PNG new file mode 100644 index 0000000..fad172b Binary files /dev/null and b/images/compress-uncompress.PNG differ diff --git a/images/deb-rpm.PNG b/images/deb-rpm.PNG new file mode 100644 index 0000000..24cf6e6 Binary files /dev/null and b/images/deb-rpm.PNG differ diff --git a/images/dpkg-fail.PNG b/images/dpkg-fail.PNG new file mode 100644 index 0000000..b4160c3 Binary files /dev/null and b/images/dpkg-fail.PNG differ diff --git a/images/dpkg-modes.PNG b/images/dpkg-modes.PNG new file mode 100644 index 0000000..12f1d1d Binary files /dev/null and b/images/dpkg-modes.PNG differ diff --git a/images/dpkg.PNG b/images/dpkg.PNG new file mode 100644 index 0000000..f0d8629 Binary files /dev/null and b/images/dpkg.PNG differ diff --git a/images/file-types.PNG b/images/file-types.PNG new file mode 100644 index 0000000..9d26381 Binary files /dev/null and b/images/file-types.PNG differ diff --git a/images/file-types1.PNG b/images/file-types1.PNG new file mode 100644 index 0000000..93f9378 Binary files /dev/null and b/images/file-types1.PNG differ diff --git a/images/file-types2.PNG b/images/file-types2.PNG new file mode 100644 index 0000000..1cbfccf Binary files /dev/null and b/images/file-types2.PNG differ diff --git a/images/filesystem.PNG b/images/filesystem.PNG new file mode 100644 index 0000000..e2dad15 Binary files /dev/null and b/images/filesystem.PNG differ diff --git a/images/functions-of-pkg.PNG b/images/functions-of-pkg.PNG new file mode 100644 index 0000000..7ff575c Binary files /dev/null and b/images/functions-of-pkg.PNG differ diff --git a/images/grep.PNG b/images/grep.PNG new file mode 100644 index 0000000..457a301 Binary files /dev/null and b/images/grep.PNG differ diff --git a/images/grep1.PNG b/images/grep1.PNG new file mode 100644 index 0000000..62611e5 Binary files /dev/null and b/images/grep1.PNG differ diff --git a/images/grep2.PNG b/images/grep2.PNG new file mode 100644 index 0000000..3fcb0fb Binary files /dev/null and b/images/grep2.PNG differ diff --git a/images/insert.PNG b/images/insert.PNG new file mode 100644 index 0000000..c85eec3 Binary files /dev/null and b/images/insert.PNG differ diff --git a/images/io.PNG b/images/io.PNG new file mode 100644 index 0000000..1f4a0db Binary files /dev/null and b/images/io.PNG differ diff --git a/images/kernel-initialize.PNG b/images/kernel-initialize.PNG new file mode 100644 index 0000000..5d9c831 Binary files /dev/null and b/images/kernel-initialize.PNG differ diff --git a/images/kernel-versions.PNG b/images/kernel-versions.PNG new file mode 100644 index 0000000..0482f51 Binary files /dev/null and b/images/kernel-versions.PNG differ diff --git a/images/lastline.PNG b/images/lastline.PNG new file mode 100644 index 0000000..1ff7b5b Binary files /dev/null and b/images/lastline.PNG differ diff --git a/images/library.PNG b/images/library.PNG new file mode 100644 index 0000000..7b1bfa7 Binary files /dev/null and b/images/library.PNG differ diff --git a/images/linux-kernel.PNG b/images/linux-kernel.PNG new file mode 100644 index 0000000..5524424 Binary files /dev/null and b/images/linux-kernel.PNG differ diff --git a/images/locate-find.PNG b/images/locate-find.PNG new file mode 100644 index 0000000..e3035df Binary files /dev/null and b/images/locate-find.PNG differ diff --git a/images/memory-management.PNG b/images/memory-management.PNG new file mode 100644 index 0000000..6366c31 Binary files /dev/null and b/images/memory-management.PNG differ diff --git a/images/mkdir_cd_working_with_shell_I.PNG b/images/mkdir_cd_working_with_shell_I.PNG new file mode 100644 index 0000000..d77aefa Binary files /dev/null and b/images/mkdir_cd_working_with_shell_I.PNG differ diff --git a/images/package-errors.PNG b/images/package-errors.PNG new file mode 100644 index 0000000..d482a75 Binary files /dev/null and b/images/package-errors.PNG differ diff --git a/images/package-managers.PNG b/images/package-managers.PNG new file mode 100644 index 0000000..e11747d Binary files /dev/null and b/images/package-managers.PNG differ diff --git a/images/package.PNG b/images/package.PNG new file mode 100644 index 0000000..2dee7a9 Binary files /dev/null and b/images/package.PNG differ diff --git a/images/pci.PNG b/images/pci.PNG new file mode 100644 index 0000000..3c3b8ef Binary files /dev/null and b/images/pci.PNG differ diff --git a/images/pipe.PNG b/images/pipe.PNG new file mode 100644 index 0000000..cdeb86a Binary files /dev/null and b/images/pipe.PNG differ diff --git a/images/pkg-mgr.PNG b/images/pkg-mgr.PNG new file mode 100644 index 0000000..28e15b5 Binary files /dev/null and b/images/pkg-mgr.PNG differ diff --git a/images/pushd_popd.PNG b/images/pushd_popd.PNG new file mode 100644 index 0000000..9f97ce6 Binary files /dev/null and b/images/pushd_popd.PNG differ diff --git a/images/rhel-centos.PNG b/images/rhel-centos.PNG new file mode 100644 index 0000000..acd7a7a Binary files /dev/null and b/images/rhel-centos.PNG differ diff --git a/images/rpm-modes.PNG b/images/rpm-modes.PNG new file mode 100644 index 0000000..550ab77 Binary files /dev/null and b/images/rpm-modes.PNG differ diff --git a/images/rpm.PNG b/images/rpm.PNG new file mode 100644 index 0000000..69bc2b4 Binary files /dev/null and b/images/rpm.PNG differ diff --git a/images/run-levels.PNG b/images/run-levels.PNG new file mode 100644 index 0000000..12d9d6f Binary files /dev/null and b/images/run-levels.PNG differ diff --git a/images/run-levels1.PNG b/images/run-levels1.PNG new file mode 100644 index 0000000..0f246e1 Binary files /dev/null and b/images/run-levels1.PNG differ diff --git a/images/run-levels2.PNG b/images/run-levels2.PNG new file mode 100644 index 0000000..14dd490 Binary files /dev/null and b/images/run-levels2.PNG differ diff --git a/images/tee.PNG b/images/tee.PNG new file mode 100644 index 0000000..6efa19b Binary files /dev/null and b/images/tee.PNG differ diff --git a/images/types-of-pkg.PNG b/images/types-of-pkg.PNG new file mode 100644 index 0000000..0edf608 Binary files /dev/null and b/images/types-of-pkg.PNG differ diff --git a/images/user-space.PNG b/images/user-space.PNG new file mode 100644 index 0000000..3170b2c Binary files /dev/null and b/images/user-space.PNG differ diff --git a/images/user-space1.PNG b/images/user-space1.PNG new file mode 100644 index 0000000..9ac7894 Binary files /dev/null and b/images/user-space1.PNG differ diff --git a/images/vi.PNG b/images/vi.PNG new file mode 100644 index 0000000..cc7761c Binary files /dev/null and b/images/vi.PNG differ diff --git a/images/working-with-hardware.PNG b/images/working-with-hardware.PNG new file mode 100644 index 0000000..4d93fe3 Binary files /dev/null and b/images/working-with-hardware.PNG differ diff --git a/images/yum-cmd.PNG b/images/yum-cmd.PNG new file mode 100644 index 0000000..00daa22 Binary files /dev/null and b/images/yum-cmd.PNG differ diff --git a/images/yum-cmd1.PNG b/images/yum-cmd1.PNG new file mode 100644 index 0000000..d306418 Binary files /dev/null and b/images/yum-cmd1.PNG differ diff --git a/images/yum-repo.PNG b/images/yum-repo.PNG new file mode 100644 index 0000000..2281ef1 Binary files /dev/null and b/images/yum-repo.PNG differ diff --git a/images/yum-update.PNG b/images/yum-update.PNG new file mode 100644 index 0000000..bc508f6 Binary files /dev/null and b/images/yum-update.PNG differ diff --git a/images/yum.PNG b/images/yum.PNG new file mode 100644 index 0000000..66449e4 Binary files /dev/null and b/images/yum.PNG differ