0% found this document useful (0 votes)
62 views

Introduction To Linux Operating System: Nabajyoti Goswami

Linux is an open-source operating system kernel created by Linus Torvalds in 1991. It uses a monolithic kernel design and is typically packaged in Linux distributions along with other open-source software. Key aspects of Linux include its modular design, use of a unified filesystem and pipes for inter-process communication, and command shells for combining simple tools into complex workflows. Linux distributions continue to evolve and become more popular and user-friendly alternatives to other proprietary operating systems.

Uploaded by

mridul73
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Introduction To Linux Operating System: Nabajyoti Goswami

Linux is an open-source operating system kernel created by Linus Torvalds in 1991. It uses a monolithic kernel design and is typically packaged in Linux distributions along with other open-source software. Key aspects of Linux include its modular design, use of a unified filesystem and pipes for inter-process communication, and command shells for combining simple tools into complex workflows. Linux distributions continue to evolve and become more popular and user-friendly alternatives to other proprietary operating systems.

Uploaded by

mridul73
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Introduction to Linux Operating System

Nabajyoti Goswami
National Institute of Electronics & Information Technology, Guwahati
Ministry of Electronics and Information Technology, Government of India
Different Operating Systems

Microsoft Windows
(1985)
Introduction  Linux is a family of open-source
Unix-like operating systems based on
the Linux kernel.

 Linux is an operating system kernel


first released on September 17, 1991, by
Linus Torvalds.

 Linux is typically packaged in a


Linux distribution.
The Operating Operating System
System
A General Understanding
Windows NT Windows 3
Windows Windows
Windows 2 Windows NT 4 2000
95
Windows Windows 1 Windows NT 3 Windows
98 Server
Windows Windows Windows 2003
2000 Client Server
Windows Windows
XP windows Server
2008
Windows Versions
Vista Windows Windows
Server Server
Windows 7 Windows 8 Windows 10 2016 2012

Distros or Distributions

Windows versions vs. Linux distributions


History of Linux
Formation & breakup of the industries
American Telephone & Telegraph
Company

Bell Telephone
Company, 1875

Alexander Graham Bell Bell System,


(1847 - 1922) 1877

AT&T was founded as Bell Telephone


Company by Alexander Graham Bell,
Thomas Watson, Gardiner Greene (2016)
Hubbard, and Thomas Sanders after
Bell's patenting of the telephone in 1875. AT&T Inc. (1983)
History of Linux (contd...)
Development of UNIX

● Multics ("Multiplexed Information and Computing Service") is an


influential early time-sharing operating system based on the
concept of a single-level memory. Multics "has influenced all
modern operating systems since, from microcomputers to
mainframes."

● AT&T had withdrawn the Multics


project in 1969 and handed over the
development to MIT and General
Electric.
● Unix operating system was conceived
and implemented by Ken Thompson
and Dennis Ritchie (both of AT&T Bell
Laboratories) in 1969 and first
released in 1970.
History of Linux (contd...)
About UNIX

• Unix is a family of multitasking, multiuser computer operating


systems that derive from the original AT&T Unix, whose
development started in the 1970s at the Bell Labs research
center.

• Unix systems are characterized by a modular design that is


sometimes called the "Unix philosophy".

• According to this philosophy, the operating system should


provide a set of simple tools, each of which performs a limited,
well-defined function.

• A unified filesystem (the Unix filesystem) and an inter-


process communication mechanism known as “pipes” serve as
the main means of communication, and a shell scripting and
command language (the Unix shell) is used to combine the
tools to perform complex workflows
History of Linux (contd...)
Development of MINIX

In 1977, the Berkeley Software Distribution (BSD) was developed by the Computer
Systems Research Group (CSRG) from UC Berkeley, based on the 6th edition of Unix
from AT&T.

In 1983, Richard Stallman started the GNU project with the goal of creating
a free UNIX-like operating system. As part of this work, he wrote the GNU
General Public License (GPL).

In 1985, Intel released the 80386, the first x86 microprocessor with a 32-bit instruction set and a memory
management unit with paging.

In 1986, Maurice J. Bach, of AT&T Bell Labs, published “The Design of the UNIX Operating System.”

In 1987, MINIX, a Unix-like system intended for academic use, was released by
Andrew S. Tanenbaum to exemplify the principles conveyed in his textbook,
MINIX3 “Operating Systems: Design and Implementation.”
History of Linux (contd...)
The origin of Linux

• MINIX's 16-bit design was not well adapted to the 32-bit features of the increasingly
cheap and popular Intel 386 architecture for personal computers. In the early nineties
a commercial UNIX operating system for Intel 386 PCs was too expensive for private
users.

• These factors and the lack of a widely adopted, free kernel


provided the momentum to start a project by Linus Torvald
at University of Helsinki while studying computer science.

• The operating system kernel first released on September


17, 1991 later became the Linux kernel.

• Development was done on MINIX using the GNU C Compiler.


The timeline
Evolution of Debian Linux
Basic Linux
Architecture

● Core hardware
● Core Kernel
● Shells & commands
● Applications & utilities
● Users
A shell is a computer program which exposes
Basics of Shell an operating system's services to a human
user or other program.

A shell interprets the commands and sends them to the


OS to perform tasks
● Terminals are application/software,
Basics of Shell which emulate a Command Line
Interface (CLI) of a Linux system.

● Nowadays, most of the Linux


distributions are GUI-based and they
use terminal to contact the Shell.

● A terminal in a GUI server emulates a


CLI in Linux server.
Terminal
Top Shells in Linux
bash zsh fish tcsh

The Bourne An extended Friendly and Tenex C Shell is


Again Shell is version of bash Interactive Shell an extended
is another version of C
the default having many
extended shell. The plus
Shell in most useful features
version of bash of tcsh is its
of the Linux like sharing of
having an scripting
distributions. It command outstanding language,
is the most history across feature of because it is
portable Shell multiple command similar to C
available. terminals. autocompletion. programming
Basics of Kernel

● A Linux kernel is a UNIX-like OS kernel


● It is a computer program which is the core interface that connects the hardware components

Software application
Hardware: CPU, memory &
devices
Basics of Kernel
Top Operations Performed by a Kernel
Resource management: Kernel decides which process gets a resource for an
operation
Memory management: Kernel has complete access to system memory and must
efficiently manage it and allow memory access to processes.
Device management: Kernel detects the connected devices, e.g., printer, usb
drive, etc. and helps the system to establish connection with the peripherals.
System calls: This is an interface between a process and the OS. When the
process does not have permissions to access a resource, a system call provides
it without the process accessing the resource directly.
Types of operating system Kernels
System
Operating system
Windows vs. Linux

Windows Linux

● Commercial ● Opensource, free


● Cost increases against number of users ● Customization is unlimited
● Customization is limited ● More secure than Windows
● Vulnerable to malware and virus threats ● Kernel type is Monolithic which provides rich
● Kernel type is Microkernel which is an access to the hardware of the system. In a
abstraction over the hardware that uses monolithic kernel, all the services of the OS
primitives or system calls to implement run along the main thread of the kernel that
the service of the Windows resides in the same area of memory where
the kernel is placed
Hardware support
Hardware support

iPOD running
µClinux

A pair of IBM mainframes.


HP iPAQ HW910 PDA
Visible software components of Linux Desktop
Linux Desktop Environments

KDE Plasma

x11
XFCE
Servers, mainframes and supercomputers
supercomputers run on Linux
Linux is everywhere
Installation Prerequisites

● Minimum 2 GB RAM but 4 GB recommended


● Oracle VirtualBox
● ISO image of Live Linux or full package.

● Minimum 2 GB RAM but 4 GB recommended


● Fresh installation with single or dual booting
● ISO image of Live Linux or full package is to be
kept in a USB drive as bootable image
● Making a bootable USB device for writing the
ISO image varies on distro to distro.
● Linux or Windows command prompt is the best
option to create a bootable USB stick.
Installation Prerequisites

● For dual booting on pre-existing Windows system, free disk space of


minimum 50 GB is required.
● After installation of Linux, the system will boot with Linux OS by default.
● Reconfiguring bootloader will prompt the boot menu.
● Connection to internet is recommended.
Package managers
Hard disk organization
Perceptions for  A typical hard disk drive (HDD) consists of
Linux installation multiple platters, which store data in magnetic form.

 The boom moves back and forth, allowing each head to


read from or write to the same location on each platter
simultaneously.

 Heads are able to read and write on both sides of each


● Hard disk organization platter. The platters are connected to the spindle and spin at
● Linux partitions the same speed.
● General concept of file system
● Linux File system root structure
● Path and variables
Hard disk organization
● One complete rotation around one side of a platter is called a track.
● The same track on both sides of all of the platters forms a cylinder.
● A typical hard drive may have thousands of cylinders.

Multiple consecutive cylinders can be


assigned to number of partitions.

● The first partition would be from cylinder 1 to cylinder 544.


● The second partition would be from cylinder 545 to cylinder 1040.
● The last partition would be from cylinder 1041 to 1600.
Linux partitions
Perceptions for
• Linux partitions can be of 3 types:
Linux installation primary (maximum four),
extended (maximum one) or
logical (contained within the extended partition).

Linux partitions

• Each partition has a type field that contains a code. This


determines the computers operating system or the partitions
file system.
Linux partition naming

● Hard disk devices are named /dev/hdx or /dev/sdx with x depending on the hardware configuration.

● Next is the partition number, starting with the count 1. Hence the four (possible) primary partitions
are numbered 1 to 4. Logical partition counting always starts at 5. Thus /dev/hda2 is the second
partition on the first ATA hard disk device, and /dev/hdb5 is the first logical partition on the second
ATA hard disk device. Same for SCSI, /dev/sdb3 is the third partition on the second SCSI disk.

Partition Device
/dev/hda1 first primary partition on /dev/hda
/dev/hda2 second primary or extended partition on /dev/hda
/dev/sda5 first logical drive on /dev/sda
/dev/sdb6 second logical on /dev/sdb
Recommended Partitioning Scheme during Installation

The following partitions are recommended during a typical installation:


● /boot – boot partition contains kernel images and grub configuration and
commands
● / – root partition
● Swap – swap partitions are used to support virtual memory. In other words,
data is written to a swap partition when there is not enough RAM to store the
data your system is processing. The size of your swap partition should be equal
to twice your computer's RAM.
● /home – optional partition
● /var – optional partition
● Any other optional partition based on application (e.g /usr/local for squid)
Perceptions for
Linux installation

 Disk file system


General concept of Linux file
systems
 Network file system
What is a file system

● Linux file system is responsible for sorting information on disk and retrieving
and updating this information.

● Windows file systems are generally New Technology File System (NTFS) and
File Allocation Table (FAT16, FAT32) or extended FAT (exFAT)

● Linux file systems are ext2, ext3, ext4, XFS, etc.

● In Linux everything is file.


Network file system (NFS)

● NFS is a distributed file system protocol originally developed by Sun


Microsystems (Sun) in 1984.

● It allows a user on a client computer to access files over a computer


network much like local storage is accessed.

● NFS, like many other protocols, builds on the Open Network Computing Remote
Procedure Call (ONC RPC) system.

● NFS is an open standard defined in a Request for Comments (RFC), allowing


anyone to implement the protocol.
Linux file system root structure

● All paths start at '/' called root, no C: or D: like in Windows. Similar to other Unix-like
systems such as Mac OS.
● Users home folders under '/home', i.e., /home/users

User 1
User 2
User 3
Perceptions for  A path identifies uniquely a file or directory in the file
system.
Linux installation
 The character '/' is used to concatenate directories.
 There are two types of paths:
 Absolute: Always start with '/' which is the root
directory. For example:
Path and variables
ls /home/users/Desktop
 Relative: All paths not beginning with '/' but with a
file o directory name. For example:
ls Desktop
 Tab' key is your friend, auto-completes the paths for
you if you press twice.
Understanding $PATH variable
o A $PATH is an environment variable that list all directories in the system with
binaries (executable programs)
o In a command line a PATH usually can be set by any of the following ways:
1. $PATH=/file/location/in/this/syntax
2. export PATH =/file/location/in/this/syntax
o PATH can be again recalled by the following command syntax:
echo $PATH (return)
/file/location/in/this/syntax will be displayed
o All binaries in one of these directories can be executed automatically in the shell,
no absolute path is needed
Some basic commands
Commands are binary files kept under specific directory.

Manipulating Files: Directory Related Disk related commands:


chmod Commands: du - Summarize disk usage of
cp cd each FILE, recursively for
file mkdir directories.
mv pwd
rm ls df - report filesystem disk space
Process Related
head usage
super user commands :
Commands:
tail su and su -
ps
cat fdisk
top
netstat sudo
File Permissions
Why Permissions ???
• Multitasking system
• Multiuser system
• Permissions can be set to files and
Directories.
chmod COMMAND
To change the permissions of a file or directory
Syntax : Types of Users
chmod assignment_expression filename Owner - owner of the file or directory.
Assignment expression comprises Group - group of related users.
• Category of users All/Other- Other users.
• Granting or denial of permission
• Types of users
Types of Permissions

Read - read the file or list files in the directory


Write - add new content to a file or add new files to the directory
Execute - access the contents of a file or access files in the directory
Types of Permissions
Permission values
Understanding chmod

Single user
chmod u+r filename
The above command grants permission to a single user to
read the file.
Multiuser
chmod u+rw , g = x ,o –w filename
The above command grants permissions to multiple users.

Octal Notation
chmod 761 filename
chmod u = rwx, g = rw,o = x filename
The above commands are equivalent to each other.
Understanding octal values
Using symbolic notations
Overriding permissions: chown, chgrp
chown command

To change the owner / user of the file / directory.


An administrator command
Only the root user can change the owner of the file / directory.
Syntax:
chown [options] newowner file/dir name

chgrp command

To change the group of a file / directory.


An administrator command.
Syntax :
chgrp [options] newgroup file/dirname
Thank you

You might also like