diff --git a/linux-masterclass/01-setup/README.md b/linux-masterclass/01-setup/README.md index ee75f1b..9b06718 100644 --- a/linux-masterclass/01-setup/README.md +++ b/linux-masterclass/01-setup/README.md @@ -1,6 +1,6 @@ # Context -Linux is the most widely used Operating System for software engineers. Most of us still prefer Windows for our day to day tasks, and dual booting can be tricky. There are a few ways in which you can still use Linux without letting go of Windows or go through the hassle of dual booting. +Linux is the most widely used Operating System by software engineers. Most of us still prefer Windows for our day to day tasks, and dual booting can be tricky. There are a few ways in which you can still use Linux without letting go of Windows or go through the hassle of dual booting. ## WSL (Windows Subsystem Linux) diff --git a/linux-masterclass/02-introduction/README.md b/linux-masterclass/02-introduction/README.md index 91c812b..cd36f1c 100644 --- a/linux-masterclass/02-introduction/README.md +++ b/linux-masterclass/02-introduction/README.md @@ -46,7 +46,7 @@ ___ ## **Why use Linux?** - Open Source - - Support almost all *Programming Languages* + - Supports almost all *Programming Languages* - Developer Friendly - Terminal is superior to CMD - Bash Scripting @@ -75,14 +75,14 @@ As a beginner you should start out with Ubuntu. ## **Why Ubuntu than any other distribution?** - It is Beginner Friendly - It has a decent UI (user interface) -- Ease to use for non-programmer also +- Ease of use for non-programmer also >Fun fact : Linux is all about of Keyboard ___ ## **What is Terminal?** -A terminal(black window) is a tool where we are going to write our commands.Start terminal using this command : `ctrl+alt+t` or you can press windows button and type terminal. +A terminal(black window) is a tool where we are going to write our commands. Start terminal using this command : `ctrl+alt+t` or you can press windows button and type terminal. ___ ## **What is SHELL?** @@ -133,10 +133,10 @@ You can use this way `~$ cd ~/home` | Task | Command | |----------------------------------------------|----------------------------------| |List files |`ls` | -|Changed directory |`cd ` | +|Change directory |`cd ` | |Clean the terminal |`clear` | |Make directory |`mkdir ` | -|Make file |`touch ` | +|Make file |`touch ` | |Reads data and opens in the terminal |`cat ` | |Previously executed commands |`history` | |Short discription of the command |`whatis ` | diff --git a/linux-masterclass/03-streams-and-files/README.md b/linux-masterclass/03-streams-and-files/README.md index fd611f0..38b4ba0 100644 --- a/linux-masterclass/03-streams-and-files/README.md +++ b/linux-masterclass/03-streams-and-files/README.md @@ -5,7 +5,7 @@ Contribute notes based on [this](https://www.youtube.com/watch?v=xVaC_G6aeH0&lis What happens when we execute a command? Linux by default has 3 standard streams:
  • stdin (standard input) code - 0
  • -
  • stdout (standard output) code - 1
  • +
  • stdout (standard output) code - 1
  • stderr (standard error) code - 2
Stream's job is to transfer data (simple text), takes input and gives output.
diff --git a/linux-masterclass/04-users-and-permissions/README.md b/linux-masterclass/04-users-and-permissions/README.md index 70f5786..f2fbb33 100644 --- a/linux-masterclass/04-users-and-permissions/README.md +++ b/linux-masterclass/04-users-and-permissions/README.md @@ -33,7 +33,7 @@ Contribute notes based on [this](https://www.youtube.com/watch?v=hxNFeL2qY-k&lis # Users-and-permissions -Linux, being a truly multi-user, multi-namespace OS, offers a lot of options when it comes to user management +Linux, being a truly multi-user, multi-namespace OS, offers a lot of options when it comes to user management. ### What are users and groups? @@ -260,9 +260,9 @@ So, the syntax goes like this: =(:) ``` -The next line starts with a `%` sign. That means that that rule applies to any user in the `sudo` group. This is convenient because you do not have to edit this file when creating new users, instead, you can add them to `sudo` group. +The next line starts with a `%` sign. Which means, that rule applies to any user in the `sudo` group. This is convenient because you do not have to edit this file when creating new users, instead, you can add them to `sudo` group. -Now, there may be cases when you need to login as genuine `root`. The `su` command switches current user to `root`, and if you run it with `sudo`, you will be able to switch to `root` using your own password: +Now, there may be cases when you need to login as genuine `root`. The `su` (switch user) command switches current user to `root`, and if you run it with `sudo`, you will be able to switch to `root` using your own password: ``` $ whoami // michael @@ -498,7 +498,7 @@ How to set permissions for a directory and all of its contents by using symbolic ### Sticky bit -The permission system in Linux has one interesting concept, called the sticky bit. A sticky bit is a parameter that can be set on any directory. It prohibits anyone other than the owner from deleting or renaming files in it. Notice, that other users may or may not be able to edit the file. Even if they can edit it, with teh sticky bit only the owner can delete or rename the file. You can set the sticky bit on a folder with this command: +The permission system in Linux has one interesting concept, called the sticky bit. A sticky bit is a parameter that can be set on any directory. It prohibits anyone other than the owner from deleting or renaming files in it. Notice, that other users may or may not be able to edit the file. Even if they can edit it, with the sticky bit only the owner can delete or rename the file. You can set the sticky bit on a folder with this command: ``` $ chmod +t someDirectory/ diff --git a/linux-masterclass/05-processes/README.md b/linux-masterclass/05-processes/README.md index 7c9b187..4f583d7 100644 --- a/linux-masterclass/05-processes/README.md +++ b/linux-masterclass/05-processes/README.md @@ -18,34 +18,34 @@ process) by requesting the kernel. Kernel decides the resources to the process. ```mermaid graph TD; - init-->|fork system call|gnemeProcess - gnemeProcess-->|fork system call|BashProcess; + init-->|fork system call|gnomeProcess + gnomeProcess-->|fork system call|BashProcess; BashProcess-->|fork system call| process; ``` ### Mother Process - Mother Process is the **first process** initiated by the kernel when system **boot up** which has PID of **1**. Mother process is also known as **init** and this process runs on **root** previledge. + Mother Process is the **first process** initiated by the kernel when system **boot up** which has PID of **1**. Mother process is also known as **init** and this process runs on **root** privileges. -### Demon Process +### Daemon Process -Demon process are the **child process** of mother. This are responsible for keeping the system running. +Daemon process are the **child process** of mother. This are responsible for keeping the system running. ```mermaid graph TD; - init-->DemonProcess1; - init-->DemonProcess2; - init-->DemonProcess3; - init-->DemonProcess4; + init-->DaemonProcess1; + init-->DaemonProcess2; + init-->DaemonProcess3; + init-->DaemonProcess4; ``` ## How process terminates - Termination of process is done by **exit system call** and **wait system call** . Kernel known whether the process is terminated or not by **termination status**. For the successful process termination status is **0**. Termination process includes the cleaning of resources utilized by the process. + Termination of process is done by **exit system call** and **wait system call** . Kernel knows whether the process is terminated or not by **termination status**. For the successful process termination status is **0**. Termination process includes the cleaning of resources utilized by the process. ### Wait system call Parent process should acknowledge the kernel by **wait system call** for completion of termination process of child. The wait system call is used by a parent process to wait for its child process to terminate and obtain its termination status. ### Orphan Process - If parent process dies,then the child process of it is adoped to the **mother**(init) by the kernel for termination of the process. So, that mother can able to acknowlegde the termination process by wait system call. In this case, the child process is known as **orphan process**. + If parent process dies,then the child process of it is adopted to the **mother**(init) by the kernel for termination of the process. So, that mother can able to acknowledge the termination process by wait system call. In this case, the child process is known as **orphan process**. ```mermaid graph TD; @@ -55,7 +55,7 @@ graph TD; ``` ### Zombie Process - When the child process termination is not acknowledge by the parent ,then the child process is treated as **zombie process** by the kernel.Further,if parent process acknowlegde the zombie process termination then this is known as **reaping**. If reaping didn't occurs then the **wait system call** is done by mother to terminate **zombie process**. + When the child process termination is not acknowledge by the parent ,then the child process is treated as **zombie process** by the kernel. Further,if parent process acknowledge the zombie process termination then this is known as **reaping**. If reaping didn't occurs then the **wait system call** is done by mother to terminate **zombie process**. # Signals It is a notification to the process that something has happened. @@ -65,7 +65,7 @@ graph TD; | Signal | Description | | ------------- | ------------- | | `SIGHUP/HUP/1` | HangUp | -| `SIGINT/INT/2` | Interput | +| `SIGINT/INT/2` | Interrupt | | `SIGKILL/KILL/9` | Kill | | `SIGSEGV/SEGV/11` | Segmentation fault | | `SIGTER/TERM/15` | Terminate | @@ -74,7 +74,7 @@ graph TD; ### Nice & Renice -Processes aren't continously run by the system.They are know in timeslots known as time slice in CPU and as cyclic as shown in below example. So, the process will take almost same time. But, we can prioritize the process by **nice & renice** command. And every process has nice which indicates priority value. If the nice value is less,the system will prioritize more or vice versa. +Processes aren't continously run by the system. They are divided in timeslots known as time slice in CPU and as cyclic as shown in below example. So, the process will take almost same time. But, we can prioritize the process by **nice & renice** command. And every process has nice which indicates priority value. If the nice value is less,the system will prioritize more or vice versa. --- Process cycle in CPU @@ -93,7 +93,7 @@ flowchart LR ### Signal Mask -Signal mask is used to block signals but there are some signals like *kill* cann't be blocked. +Signal mask is used to block signals but there are some signals like *kill* can't be blocked. # States of process diff --git a/linux-masterclass/06-partitions/README.md b/linux-masterclass/06-partitions/README.md index 868ea21..cbe2800 100644 --- a/linux-masterclass/06-partitions/README.md +++ b/linux-masterclass/06-partitions/README.md @@ -31,12 +31,12 @@ ls -l /dev * /sbin -> system binaries which are run by the root ## Journaling Used to repair any inconsistencies that occur as the result of an improper shutdown of the computer -Suppose you were copying a file, if the system then also we can able to identify the currupt file by using *journaling*. +Suppose you were copying a file, if the system crashes then also we can able to identify the currupt file by using *journaling*. ## Desktop file types -|Destop file types| Description| +|Desktop file types| Description| |---|---| -| ext 4 | latest & standard choice of file system which support disk space of 1exabyte of file sixe 16 TB| +| ext 4 | latest & standard choice of file system which supports disk space of 1exabyte of file sixe 16 TB| | Btrfs| Butter/Better file system and it is not stable than other| | XFS | high performance journaling file system generally good for servers| | NTFS & FAT| windows file system| @@ -46,41 +46,41 @@ To check filesystem of linux :- ``` df -T ``` -We can create multiple partitions in any disk and each parttion act as an individual **block device**.And each block system can act as different filesystem. +We can create multiple partitions in any disk and each partition act as an individual **block device**. And each block system can act as different filesystem. -## Nodes and innodes -Nodes tables are just like dtabase to manage files .In this table each file or directory has innode and contains the information about the file. +## Nodes and inodes +Nodes tables are just like database to manage files. In this table each file or directory has inode and contains the information about the file. ### Partition Table To check how a disk is partitioned. -THere are two main parttion schemes -* MBR -> Mast er Boot Record -* GRT -> GUID partition table +There are two main parttion schemes +* MBR -> Master Boot Record +* GPT -> GUID partition table ## MBR - It is a traditional partition table ,supports the disk upto *2TB*. WHich has linmitations of 4 parts only known as *primary partitions*. Out of these 4 we can create one extended partition & in that can create multiple logical partitions same as creating primary partitions. + It is a traditional partition table ,supports the disk upto *2TB*. Which has limitations of 4 parts only known as *primary partitions*. Out of these 4 we can create one extended partition & in that we can create multiple logical partitions same as creating primary partitions. ### GPT - This is new standard each partition has globally unique ID(GUID) and usually used with UEFI based looting . + This is new standard, each partition has globally unique ID(GUID) and usually used with UEFI based booting . ## Filesystem Structure - FS is part of an organized collection of files & directives. It's like a database to manage files. + FS is part of an organized collection of files & directories. It's like a database to manage files. FS has 4 major components - * Bootblock + * BootBlock * SuperBlock - * Innode table + * Inode table * Data Blocks # Inode - Inode, short of index node tables are just like database to manage files in this table each file or directory has inode & it generally describes all the info about file. Contains everything execpt for file & it's name , also contains pointers to datablocks of file. - When file system is created ,some space for the innodes is also allocated as well. + Inode, short of index node tables are just like database to manage files in this table each file or directory has inode & it generally describes all the info about file. Contains everything except for file & it's name , also contains pointers to datablocks of file. + When file system is created ,some space for the inodes is also allocated as well. ``` df -i ``` -This is the command to check how many innodes are availabele. +This is the command to check how many inodes are available. ``` ls -li @@ -88,4 +88,4 @@ ls -li This is the command to check inodes number. ### How do inodes work and locate file ![Untitled Diagram drawio (1)](https://user-images.githubusercontent.com/120579608/234055609-51a0d8d1-0e67-4e1c-9091-71c7c2c48f18.png) -Innode points to the actual data block of file in the file system. Each and every innode contains 15 pointers.When a file is created on a file system, the file system allocates a new inode and stores the file's metadata in the inode data structure. The file system also allocates the necessary data blocks to store the file's contents and links them to the inode by storing their addresses in the inode's data block pointers. +Inode points to the actual data block of file in the file system. Each and every inode contains 15 pointers. When a file is created on a file system, the file system allocates a new inode and stores the file's metadata in the inode data structure. The file system also allocates the necessary data blocks to store the file's contents and links them to the inode by storing their addresses in the inode's data block pointers. diff --git a/linux-masterclass/07-kernel/README.md b/linux-masterclass/07-kernel/README.md index 5825f3e..646ad41 100644 --- a/linux-masterclass/07-kernel/README.md +++ b/linux-masterclass/07-kernel/README.md @@ -4,7 +4,7 @@ Contribute notes based on [this](https://www.youtube.com/watch?v=08SwnaMhL1k&lis ## Stages of boot process ### 1. BIOS -basic input output system. It initialises the hardware, it makes sures the hardware is good to go , by running self tests in which it checks , memory is good , hdd, ssd etc. +basic input output system. It initialises the hardware, it makes sures the hardware is good to go , by running self tests in which it checks , memory is good, hdd, ssd etc. Main job of Bios is to load the bootloader. ### 2. Bootloader @@ -14,13 +14,13 @@ Commonly used boot loader --> GRUB bootloader ### 3. Kernel As soon as it is loaded, it immediately initialises the memory and the devices that are there in the system. Main job is to load the init process or mother process. -Init process- starts and stops all the essential process is it is very first process (mother process) +Init process- starts and stops all the essential process; It is the very first process (mother process) # Levels of abstraction of Linux OS ### 1. Hardware -CPU,memory ports , HDD , SSD etc.Physical layer which computes what our system is doing. +CPU, memory ports, HDD, SSD etc. Physical layer which computes what our system is doing. ### 2. Kernel -Responsible for handling processes, memory, device communication, setting up entire file system,also responsible for for system calls. +Responsible for handling processes, memory, device communication, setting up entire file system, also responsible for for system calls. ### 3. User Space All we see in front of us, apps comes under user space. diff --git a/linux-masterclass/08-resource-utilization/README.md b/linux-masterclass/08-resource-utilization/README.md index 9e354ca..d3ef11f 100644 --- a/linux-masterclass/08-resource-utilization/README.md +++ b/linux-masterclass/08-resource-utilization/README.md @@ -46,7 +46,7 @@ Whatever happening in our system is getting saved as logs in `/var` directory . logs are created via service `syslog` which is implemented by syslogd daemon and sends all info to system logger. ## Logrotate -Designed to ease administration of system that generates large no.of log files by allowing removal ,rotation ,compression and maling of log files. +Designed to ease administration of system that generates large no. of log files by allowing removal ,rotation ,compression and mailing of log files. ``` ls /etc/logrotate.log @@ -60,4 +60,4 @@ cat /etc/logrotate.log/apt ![image](https://user-images.githubusercontent.com/120579608/229374626-9ae0285f-05a2-4788-ae40-6e2ee05ad8f2.png) - In the above example when we observe the apt log file ,we can observe configuration settings. + In the provided example, when we examine the apt log file, we notice configuration settings. \ No newline at end of file