Linux Workshop


Hello Everyone...!!!
I am back with my new and exciting blog on Linux Workshop conducted by Mr. Pranav Jambare.
In this blog, we are going to discussing about the concepts learned on Day 6 of the Linux Workshop.
So, Let's start with Content.
Contents :
Booting Process
Access Control
Processes
Booting Process :-
There are six stages of booting Process :-
- BIOS :-
BIOS stands for Basic input/output system.
BIOS is the program a computer's microprocessor uses to start the computer system after it is powered on.
It also manages data flow between the computer's operating system (OS) and attached devices, such as the hard disk, video adapter, keyboard, mouse and printer.
The main use of BIOS is to act as a middleman between OSes and the hardware they run on.
- MBR :-
MBR stands for Master Boot record.
The Master Boot Record (MBR) is the information in the first sector of a hard disk or a removable drive.
It identifies how and where the system's operating system (OS) is located in order to be booted (loaded) into the computer's main storage or random access memory (RAM).
The MBR is located in the 1st sector of the bootable disk, which is typically
/dev/hda
, or/dev/sda
, depending on your hardware.
- GRUB :-
GRUB stands for GRand Unified Bootloader.
GRUB function is to take over from BIOS at boot time, load itself, load the Linux kernel into memory, and then turn over execution to the kernel.
Once the kernel takes over, GRUB has done its job and it is no longer needed.
In many systems, you can find the GRUB configuration file at
/boot/grub/grub.conf
or/etc/grub.conf
depending on the Linux Flavour.
- Kernal :-
The Linux kernel is the foundation of the Linux computer operating system.
A kernel is the lowest level of software that can interface with computer hardware.
Boot loader finds the kernel image on the disk and loads it into memory, to start the system.
The kernel initializes the devices and their drivers.
The kernel mounts the basis filesystem. The kernel starts a program referred to as init with a method ID zero.
Then it executes the
/sbin/init
program, which is always the first program to be executed. You can confirm this with its process id (PID), which should always be 1.
- Init.d / system.d :-
At this point, your system executes run-level programs.
Then other processes, services, daemons, and threads are started by init. So init. d is a configuration database for the init process.
It is the first process and is considered as "The mother of processes".
- Run Level :-
Run level 1 –>
rescue.target
(runlevel1.target
is a symbolic link torescue.target
).Run level 2 –>
multi-user.target
(runlevel2.target
is a symbolic link tomulti-user.target
).Run level 3 –>
multi-user.target
(runlevel3.target
is a symbolic link tomulti-user.target
).Run level 4 –> This level is user definable.
Run level 5 –>
graphical.target
(runlevel5.target
is a symbolic link tographical.target
).Run level 6 –>
reboot.target
(andrunlevel6.target
is a symbolic link toreboot.target
).
All above stages are included in Booting Process.
Access Control
This type of situation is what Linux Access Control Lists (ACLs) were intended to resolve. ACLs allow us to apply a more specific set of permissions to a file or directory without (necessarily) changing the base ownership and permissions.
There are three types of Permissions in Linux :/
r ----> read
w ----> write
x ----> execut
- Those three permissions are given to three owners :
User (file/directory owner)
Group owner
Other users
ACLs are used to make a flexible permission mechanism in Linux.
ACL allows you to give permissions for any user or group to any disc resource.
Syntax of ACL :-
#General Syntax
setfacl <options>:<username>:<permissions> <directory name>
#To add permission for user
setfacl -m u:<user>:<permissions> <directory name>
#To add permissions for a group
setfacl -m g:<group>:<permissions> <directory name>
#To allow all files or directories to inherit ACL entries from the directory it is within
setfacl -dm <entry> </path/to/dir>
Example :-
[root@localhost ~]$ cd /tmp
[root@localhost ~]$ mkdir testACL
[root@localhost ~]$ ls -ld testACL
drwxr--xr-x. 2 root root 30 Jul 19 01:16 testACL
Processes :-
A Process is any active (running) instance of a program.
A program is any executable file held in storage on your machine.
Anytime you run a program, you have created a process.
Whenever a command is issued in Linux, it creates/starts a new process. For example,
pwd
when issued which is used to list the current directory location the user is in, a process starts.Each process in the system has a unique PID. Linux keeps an account of the processes, this number is called process ID or PID.
Processes States :-
- There are 5 states of Processes :-
Created
Ready
Running
Waiting
Terminate
- Types of Processes :-
Parent Process :- A parent process is a process that has created one or more child processes.
Child Process :- A child process is a process that is created by another process known as the parent process.
Orphan Process :- The orphan process can occur in Linux when a parent process terminates unexpectedly or fails to properly manage the child process.
Zombie Process :- Zombie process can occur in Linux when a parent process fails to properly manage its child processes and can consume system resources if not properly terminated.
Processes Commands :-
Top command :-
#top syntax
$ top
#top command is used to display the system;s current resource usage
#and the processes that are running on the system.
Nice command :-
#Syntax for nice
$ nice -n <niceNumber> <command>
PS Command :-
#displays a list of the processes that are currently runnung along with pid and other information
$ ps -ef|grep top
Some basic Commands :-
#syntax
$ kill <options> <pid>
#terminate
$ kill -15 5367
#kill
$ kill -9 5367
#resume
$ kill -18 5367
#suspend
$ kill -19 5367
#background process run
$ bg %<jobNO>
#foreground process run
$ fg %<jobNo>
#to check status
$ job
These topics are coverd on Day 6. I hope you enjoy this blog.
Thanks you for reading blog.........!!!!!
Subscribe to my newsletter
Read articles from Ayush Bhosale directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Ayush Bhosale
Ayush Bhosale
Student at Dr. Babasaheb Ambedkar University Lonere, in computer science