You are on page 1of 13

• Linux is an open-source operating system (OS).

Linux & • Being an open-source OS, anyone can do their own customizations and use
the system for various purposes.

History of
• In 1991, Linus Torvalds developed this OS as a part of his university project
• In 1992, Linus released this OS to the world under General Public
License[GPL ], so that anyone can run, study, share and modify the software
Linux • As the years passed, various flavours of Linux gets originated.
Eg: Red Hat, Fedora, Debian, Ubuntu, Kali
This is a command line-based operating system.
Shell is the program that acts as an interface to users, for the operating
system. Major Linux shells are
 Bourne Shell (sh)
More info  C Shell (csh)

about Linux
 KornShell (ksh)
 Bourne Again Shell (bash)
In Linux, there are three different user types: superuser, regular, and
service
A service (or daemon) is a script that runs in the background. It listens
continuously for incoming requests and sends a response based on the
given request. This is different from processes
There are 6 distinct stages in the typical booting process.

1) BIOS (Basic Input Output System).


The BIOS first performs POST and some integrity checks of the HDD or SSD.
Then the BIOS searches for, loads, and executes the boot loader program, which is the
Master Boot Record (MBR). The MBR is sometimes on a USB stick or CD-ROM such as with a live
installation of Linux.

Booting of 2) MBR (Master Boot Record)

Linux Server MBR is located in the 1st sector of the bootable disk, which is typically /dev/hda, or
/dev/sda, depending on your hardware. The MBR contains information about GRUB.
3) GRUB (Grand Unified Boot Loader)
Grand Unified Bootloader, is the typical boot loader for most modern Linux systems. The
GRUB splash screen is often the first thing you see when you boot your computer. It has a simple menu
where you can select some options. If we have multiple kernel images installed, we can select the one
which we want system to boot with. By default, the latest kernel image is selected.
The default GRUB configuration file is at /boot/grub/grub.conf or /etc/grub.conf. Sample config file of GRUB

#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5PAE)
root (hd0,0)

Booting of kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/


initrd /boot/initrd-2.6.18-194.el5PAE.img

Linux Server 4) Kernel


Kernel is the heart of Linux operating systems. In this stage of the boot process, the kernel that was selected by
GRUB first mounts the root file system that's specified in the grub.conf file. After it executes the /sbin/init program, which is always
the first program to be executed. So, process ID associated with this is always 1.

The kernel then establishes a temporary root file system using Initial RAM Disk (initrd) until the real file system is mounted.

5) Init
• Now the system starts to execute the runlevel programs.
• It would look for an init file, to decide the Linux run level.
5) Init
Now the system starts to execute the runlevel programs.
It would look for an init file, to decide the Linux run level.
Following are the available run levels 0-6
0 – halt
1 – Single user mode
2 – Multiuser, without NFS
3 – Full multiuser mode

Booting of 4 – unused
5 – X11

Linux Server 6 – reboot

6) Run level programs


Depending on our default init level setting, the system will execute the programs from one of the following directories.
 Run level 0 – /etc/rc.d/rc0.d/
 Run level 1 – /etc/rc.d/rc1.d/
 Run level 2 – /etc/rc.d/rc2.d/
 Run level 3 – /etc/rc.d/rc3.d/
 Run level 4 – /etc/rc.d/rc4.d/
 Run level 5 – /etc/rc.d/rc5.d/
 Run level 6 – /etc/rc.d/rc6.d/
• This is a text-based command line interface which we can give instructions to
the Linux server.
• Bash  Bourne-Again shell
• When a regular user starts the shell default prompt ends with a ‘$’ character.

Bash Shell [root@localhost~]$


• When a superuser or root user starts the shell the default prompt ends with ‘#’
character
[root@localhost~]#
Directory
structure in
Linux
• hostname  Displays the hostname of the server
[root@localhost~]#hostname
localhost.localadmin

Basic
[root@localhost~]#

commands in • ip addr  Displays the IP address of the server


[root@localhost]# ip addr

linux 1: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:80:07:e2 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.33/24 brd 192.168.0.255 scope global eth0
inet6 fe80::250:56ff:fe80:7e2/64 scope link valid_lft forever preferred_lft
forever
[root@localhost]#
• date  To display current date , time and year
• Uptime  To display the system powerup time.
• pwd  Present working directory
[root@localhost]# pwd

/root

[root@localhost]#

• cd  Change Directory
[root@localhost]# cd /var

Basic [root@localhost var]#

• ls  List the files in current directory

commands in [root@localhost]# ls

dir1 dir2 file1 file2

Linux
[root@localhost]#

• ls –la  Long listing including the hidden files


[root@localhost]# ls -la

dr-xr-x---. 10 root root 4096 Sep 27 23:00 .

dr-xr-xr-x. 18 root root 241 Sep 20 13:28 ..

-rw-------. 1 root root 1688 Mar 26 2021 anaconda-ks.cfg

-rw-------. 1 root root 132814 Sep 27 23:00 dir1

-rw-r--r--. 1 root root 18 Aug 12 2018 dir2

[root@localhost]#

• Touch <file_name>  Used for creating an empty file.


• man < command >  Displays the help for the particular command
• mkdir <directory>  Create a folder
• cp –r dir1 dir2  copy a directory from one location to other
• rm –rf <directory name>  Remove the whole directory and it’s contents
Basic • touch <file>  Create a file

commands in
• vim <filename>  To edit the file
• systemctl restart network  command to restart our network service

linux • top  Display the current process in the system.


• yum  Command to install the software / package into the system
• su <username>  change the user
• whoami  will display the current login user
User
• Every process on the system runs as a particular user
• Every file is owned by a particular user.
• Access to files and directories are restricted by the user.

Groups

Local Users • Two types of groups :- Primary and Supplementary group.


• Every user has exactly one Primary group.
& Groups in • Supplementary group membership is used to help ensure that user is have
access permissions to files and other resources in the system.
Linux
Root User
• This is the administrative user or superuser, a user that has all the power over
the system.
• Root user has unlimited privileges

You might also like