SlideShare a Scribd company logo
Chapter 2
Introduction to UNIX concepts
Meenal K Jabde
Modern College of Arts, Science and Commerce
Ganeshkhind, Pune 16
Agenda
1. Introduction to Unix Operating System.
2. Features of Unix.
3. Architecture of the Unix Operating System.
4. Introduction to File System and Process Environment.
5. Working with Unix
The login prompt.
General features of Unix commands/ command structure.
Command arguments and options.
Understanding of some basic commands such as echo, printf, ls,
who,
date, passwd, cal, Combining commands
Introduction to Unix Operating System.
 Unix is an Operating System that is truly the base of
all Operating Systems like Ubuntu, Solaris, POSIX,
etc.
 It was developed in the 1970s by Ken Thompson,
Dennis Ritchie, and others in the AT&T Laboratories.
 It was originally meant for programmers developing
software rather than non-programmers.
 Unix was the heart of the operating System.
Unix Architecture
 Layer-1: Hardware – It consists of all hardware related
information.
 Layer-2: Kernel –
It interacts with hardware and most of the tasks like
memory management, task scheduling, and management
are done by the kernel.
 Layer-3: Shell commands –
Shell is the utility that processes your requests. When you
type in a command at the terminal, the shell interprets the
command and calls the program that you want.
There are various commands like cp, mv, cat, grep, id, wc,
nroff, a.out and more.
 Layer-4: Application Layer –
It is the outermost layer that executes the given external
applications.
kernel and its block diagram
 The system call and library interface represent the border between user programs and the kernel. System
calls look like ordinary function calls in C programs. Assembly language programs may invoke system
calls directly without a system call library. The libraries are linked with the programs at compile time.
 The set of system calls into those that interact with the file subsystem and some system calls interact
with the process control subsystem. The file subsystem manages files, allocating file space, administering
free space, controlling access to files, and retrieving data for users.
 Processes interact with the file subsystem via a specific set of system calls, such as open (to open a file
for reading or writing), close, read, write, stat (query the attributes of a file), chown (change the record of
who owns the file), and chmod (change the access permissions of a file).
 The file subsystem accesses file data using a buffering mechanism that regulates data flow between the
kernel and secondary storage devices. The buffering mechanism interacts with block I/O device drivers to
initiate data transfer to and from the kernel.
 Device drivers are the kernel modules that control the operator of peripheral devices. The file subsystem
also interacts directly with “raw” I/O device drivers without the intervention of the buffering mechanism.
Finally, the hardware control is responsible for handling interrupts and for communicating with the
machine. Devices such as disks or terminals may interrupt the CPU while a process is executing. If so,
the kernel may resume execution of the interrupted process after servicing the interrupt.
 Interrupts are not serviced by special processes but by special functions in the kernel, called in the
context of the currently running process.
Features of Unix Operating System
Introduction to File System and Process Environment.
 Unix file system is a logical method of organizing and
storing large amounts of information in a way that
makes it easy to manage.
 A file is a smallest unit in which the information is
stored. Unix file system has several important
features.
 All data in Unix is organized into files. All files are
organized into directories. These directories are
organized into a tree-like structure called the file
system.
 Files in Unix System are organized into multi-level
hierarchy structure known as a directory tree.
 At the very top of the file system is a directory called
“root” which is represented by a “/”. All other files are
“descendants” of root.
Types of Unix files –
The UNIX files system
contains several
different types of files.
 1. Ordinary files – An ordinary file is a file on the system that
contains data, text, or program instructions.
 2. Directories – Directories store both special and ordinary files.
 3. Special Files – Used to represent a real physical device such as
a printer, tape drive or terminal, used for Input/Output (I/O)
operations.
 4. Pipes – UNIX allows you to link commands together using a
pipe.
 5. Sockets – A Unix socket (or Inter-process communication
socket) is a special file which allows for advanced inter-process
communication.
 6. Symbolic Link – Symbolic link is used for referencing some
other file of the file system. Symbolic link is also known as Soft
link.
Unix Command Line Structure
 A command is a program that tells the Unix system to do something. It has the
form:
 command [options] [arguments]
 where an argument indicates on what the command is to perform its action,
usually a file or series of files. An option modifies the command, changing the
way it performs.
 Commands are case sensitive. command and Command are not the same.
 Options are generally preceded by a hyphen (-), and for most commands, more
than one option can be strung together, in the form:
 command -[option][option][option]
Basic Commands
 Listing Files- To list the files and directories stored in the current directory, use
the following command −
 $ls
 Here is the sample output of the above command −
 $ls
 bin hosts lib res.03
 ch07 hw1 pub test_results
 ch07.bak hw2 res.01 users
 docs hw3 res.02 work
 The command ls supports the -l option which would help you to get more information
about the listed files −
 $ls -l
 total 1962188
 drwxrwxr-x 2 amrood amrood 4096 Dec 25 09:59 uml
 -rw-rw-r-- 1 amrood amrood 5341 Dec 25 08:38 uml.jpg
 drwxr-xr-x 2 amrood amrood 4096 Feb 15 2006 univ
 drwxr-xr-x 2 root root 4096 Dec 9 2007 urlspedia
 -rw-r--r-- 1 root root 276480 Dec 9 2007 urlspedia.tar
 drwxr-xr-x 8 root root 4096 Nov 25 2007 usr
 drwxr-xr-x 2 200 300 4096 Nov 25 2007 webthumb-1.01
 -rwxr-xr-x 1 root root 3192 Nov 25 2007 webthumb.php
 -rw-rw-r-- 1 amrood amrood 20480 Nov 25 2007 webthumb.tar
 -rw-rw-r-- 1 amrood amrood 5654 Aug 9 2007 yourfile.mid
 -rw-rw-r-- 1 amrood amrood 166255 Aug 9 2007 yourfile.swf
 drwxr-xr-x 11 amrood amrood 4096 May 29 2007 zlib-1.2.3
echo Command
 echo command in linux is used to display line of text/string that
are passed as an argument . This is a built-in command that is
mostly used in shell scripts and batch files to output status text to
the screen or a file.
 Syntax :
 echo [option] [string]
 Displaying a text/string :
 Syntax :
 echo [string]
Printf command
 “printf” command in Linux is used to display the
given string, number or any other format
specifier on the terminal window. It works the
same way as “printf” works in programming
languages like C.
 Syntax:
 $printf [-v var] format [arguments]
 printf can have format specifiers, escape
sequences or ordinary characters.
 Format Specifiers: The most commonly used
printf specifiers are %s, %b, %d, %x and %f.
 %s specifier: It is basically a string specifier for string
output.
 $printf "%sn" "Hello, World!"
 %b specifier: It is same as string specifier, but it allows
us to interpret escape sequences with an argument.
Input : printf "%bn" "Hello, World! n" "From Geeks For
Geeksn"
Output: Hello, World!
From Geeks For Geeks
who command
who command is used to find out the following
information :
1. Time of last system boot
2. Current run level of the system
3. List of logged in users and more.
Description : The who command is used to get
information about currently logged in user on to system.
 Syntax : $who [options] [filename]
Examples :
 1. The who command displays the following information for each
user currently logged in to the system if no option is provided :
 Login name of the users
 Terminal line numbers
 Login time of the users in to system
 Remote host name of the user
 hduser@mahesh-Inspiron-3543:~$ who
 hduser tty7 2018-03-18 19:08 (:0)
 hduser@mahesh-Inspiron-3543:~$
Date command
 date command is used to display the system
date and time. date command is also used to
set date and time of the system. By default the
date command displays the date in the time
zone on which unix/linux operating system is
configured.You must be the super-user (root) to
change the date and time.
 Syntax:
 date [OPTION]... [+FORMAT]
 Command:
 $date
 Output:
 Tue Oct 10 22:55:01 PDT 2017
Passwd command
 passwd command in Linux is used
to change the user account
passwords. The root user
reserves the privilege to change
the password for any user on the
system, while a normal user can
only change the account
password for his or her own
account.
 Syntax:
 passwd [options] [username]
cal command
 If a user wants a quick view of calendar
in Linux terminal, cal is the command
for you. By default, cal command shows
current month calendar as output.
 cal command is a calendar command in
Linux which is used to see the calendar
of a specific month or a whole year.
 Syntax:
 cal [ [ month ] year]
 Rectangular bracket means it is optional,
so if used without option, it will display
a calendar of current month and year.
 cal : Shows current month calendar on
the terminal
Combining commands
This will give you a listing of the
current directory ( ls ), find out
which directory you’re currently in (
pwd ), and display your login name (
whoami ) all at once.
The Logical AND
Operator (&&)
 If you want the second command to only
run if the first command is successful,
separate the commands with the logical
AND operator, which is two ampersands
( && ). For example, we want to make a
directory called MyFolder and then
change to that directory–provided it was
successfully created. So, we type the
following on the command line and
press Enter.
 mkdir MyFolder && cd MyFolder
 The folder was successfully created, so
the cd command was executed, and we
are now in the new folder.
Option Three: The
Logical OR Operator (||)
 Sometimes you might want to execute a second
command only if the first command does not
succeed. To do this, we use the logical OR
operator, or two vertical bars ( || ). For example,
we want to check to see if the MyFolder
directory exists ( [ -d ~/MyFolder ] ) and create
it if it doesn’t ( mkdir ~/MyFolder ). So, we
type the following command at the prompt and
press Enter.
 [ -d ~/MyFolder ] || mkdir ~/MyFolder
 Be sure there is a space after the first bracket
and before the second bracket or the first
command that checks if the directory exists will
not work.
Thank You

More Related Content

What's hot

Linux kernel
Linux kernelLinux kernel
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
Gaurav Mishra
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Nishant Munjal
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
Henry Osborne
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
Ramasubbu .P
 
Linux file system
Linux file systemLinux file system
Linux file system
Md. Tanvir Hossain
 
Linux Introduction
Linux IntroductionLinux Introduction
Linux Introduction
Libsoul Technologies Pvt. Ltd.
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
Md. Zahid Hossain Shoeb
 
Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
Alea Soluciones, S.L.
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
sureskal
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
sudhir singh yadav
 
Linux introduction, class 1
Linux introduction, class 1Linux introduction, class 1
Linux introduction, class 1
Adrian Mikeliunas
 
Linux installation
Linux installationLinux installation
Linux installation
Sofcon India Pvt Ltd.
 
Linux basics
Linux basicsLinux basics
Linux basics
Santosh Khadsare
 
Booting and Start-up Sequence
Booting and Start-up SequenceBooting and Start-up Sequence
Booting and Start-up Sequence
Trinity Dwarka
 
Unix ppt
Unix pptUnix ppt
Unix ppt
sudhir saurav
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
Dominique Cimafranca
 
Linux
LinuxLinux

What's hot (20)

Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux Introduction
Linux IntroductionLinux Introduction
Linux Introduction
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Linux introduction, class 1
Linux introduction, class 1Linux introduction, class 1
Linux introduction, class 1
 
Linux installation
Linux installationLinux installation
Linux installation
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Booting and Start-up Sequence
Booting and Start-up SequenceBooting and Start-up Sequence
Booting and Start-up Sequence
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Linux
LinuxLinux
Linux
 

Similar to Chapter 2 Introduction to Unix Concepts

Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
Priyadarshini648418
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
homeworkping3
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
amol_chavan
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
Mohit Belwal
 
Unix notes
Unix notesUnix notes
Unix environment [autosaved]
Unix environment [autosaved]Unix environment [autosaved]
Unix environment [autosaved]
Er Mittinpreet Singh
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
Devang Garach
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
midhunjose4u
 
Unix1
Unix1Unix1
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
Raghu nath
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
Rajesh Kumar
 
Linux
LinuxLinux
Basic Commands-part1.pptx
Basic Commands-part1.pptxBasic Commands-part1.pptx
Basic Commands-part1.pptx
GOGOMASTER2
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
Julio Pulido
 
3. intro
3. intro3. intro
3. intro
Harsh Shrimal
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
cisco
ciscocisco
cisco
edomaldo
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiIntroduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Sowmya Jyothi
 
Linuxppt
LinuxpptLinuxppt

Similar to Chapter 2 Introduction to Unix Concepts (20)

Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Unix notes
Unix notesUnix notes
Unix notes
 
Unix environment [autosaved]
Unix environment [autosaved]Unix environment [autosaved]
Unix environment [autosaved]
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Unix1
Unix1Unix1
Unix1
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
Linux
LinuxLinux
Linux
 
Basic Commands-part1.pptx
Basic Commands-part1.pptxBasic Commands-part1.pptx
Basic Commands-part1.pptx
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
 
3. intro
3. intro3. intro
3. intro
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
cisco
ciscocisco
cisco
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiIntroduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 

Chapter 2 Introduction to Unix Concepts

  • 1. Chapter 2 Introduction to UNIX concepts Meenal K Jabde Modern College of Arts, Science and Commerce Ganeshkhind, Pune 16
  • 2. Agenda 1. Introduction to Unix Operating System. 2. Features of Unix. 3. Architecture of the Unix Operating System. 4. Introduction to File System and Process Environment. 5. Working with Unix The login prompt. General features of Unix commands/ command structure. Command arguments and options. Understanding of some basic commands such as echo, printf, ls, who, date, passwd, cal, Combining commands
  • 3. Introduction to Unix Operating System.  Unix is an Operating System that is truly the base of all Operating Systems like Ubuntu, Solaris, POSIX, etc.  It was developed in the 1970s by Ken Thompson, Dennis Ritchie, and others in the AT&T Laboratories.  It was originally meant for programmers developing software rather than non-programmers.  Unix was the heart of the operating System.
  • 4. Unix Architecture  Layer-1: Hardware – It consists of all hardware related information.  Layer-2: Kernel – It interacts with hardware and most of the tasks like memory management, task scheduling, and management are done by the kernel.  Layer-3: Shell commands – Shell is the utility that processes your requests. When you type in a command at the terminal, the shell interprets the command and calls the program that you want. There are various commands like cp, mv, cat, grep, id, wc, nroff, a.out and more.  Layer-4: Application Layer – It is the outermost layer that executes the given external applications.
  • 5. kernel and its block diagram
  • 6.  The system call and library interface represent the border between user programs and the kernel. System calls look like ordinary function calls in C programs. Assembly language programs may invoke system calls directly without a system call library. The libraries are linked with the programs at compile time.  The set of system calls into those that interact with the file subsystem and some system calls interact with the process control subsystem. The file subsystem manages files, allocating file space, administering free space, controlling access to files, and retrieving data for users.  Processes interact with the file subsystem via a specific set of system calls, such as open (to open a file for reading or writing), close, read, write, stat (query the attributes of a file), chown (change the record of who owns the file), and chmod (change the access permissions of a file).  The file subsystem accesses file data using a buffering mechanism that regulates data flow between the kernel and secondary storage devices. The buffering mechanism interacts with block I/O device drivers to initiate data transfer to and from the kernel.  Device drivers are the kernel modules that control the operator of peripheral devices. The file subsystem also interacts directly with “raw” I/O device drivers without the intervention of the buffering mechanism. Finally, the hardware control is responsible for handling interrupts and for communicating with the machine. Devices such as disks or terminals may interrupt the CPU while a process is executing. If so, the kernel may resume execution of the interrupted process after servicing the interrupt.  Interrupts are not serviced by special processes but by special functions in the kernel, called in the context of the currently running process.
  • 7. Features of Unix Operating System
  • 8. Introduction to File System and Process Environment.  Unix file system is a logical method of organizing and storing large amounts of information in a way that makes it easy to manage.  A file is a smallest unit in which the information is stored. Unix file system has several important features.  All data in Unix is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the file system.  Files in Unix System are organized into multi-level hierarchy structure known as a directory tree.  At the very top of the file system is a directory called “root” which is represented by a “/”. All other files are “descendants” of root.
  • 9. Types of Unix files – The UNIX files system contains several different types of files.
  • 10.  1. Ordinary files – An ordinary file is a file on the system that contains data, text, or program instructions.  2. Directories – Directories store both special and ordinary files.  3. Special Files – Used to represent a real physical device such as a printer, tape drive or terminal, used for Input/Output (I/O) operations.  4. Pipes – UNIX allows you to link commands together using a pipe.  5. Sockets – A Unix socket (or Inter-process communication socket) is a special file which allows for advanced inter-process communication.  6. Symbolic Link – Symbolic link is used for referencing some other file of the file system. Symbolic link is also known as Soft link.
  • 11. Unix Command Line Structure  A command is a program that tells the Unix system to do something. It has the form:  command [options] [arguments]  where an argument indicates on what the command is to perform its action, usually a file or series of files. An option modifies the command, changing the way it performs.  Commands are case sensitive. command and Command are not the same.  Options are generally preceded by a hyphen (-), and for most commands, more than one option can be strung together, in the form:  command -[option][option][option]
  • 12. Basic Commands  Listing Files- To list the files and directories stored in the current directory, use the following command −  $ls  Here is the sample output of the above command −  $ls  bin hosts lib res.03  ch07 hw1 pub test_results  ch07.bak hw2 res.01 users  docs hw3 res.02 work
  • 13.  The command ls supports the -l option which would help you to get more information about the listed files −  $ls -l  total 1962188  drwxrwxr-x 2 amrood amrood 4096 Dec 25 09:59 uml  -rw-rw-r-- 1 amrood amrood 5341 Dec 25 08:38 uml.jpg  drwxr-xr-x 2 amrood amrood 4096 Feb 15 2006 univ  drwxr-xr-x 2 root root 4096 Dec 9 2007 urlspedia  -rw-r--r-- 1 root root 276480 Dec 9 2007 urlspedia.tar  drwxr-xr-x 8 root root 4096 Nov 25 2007 usr  drwxr-xr-x 2 200 300 4096 Nov 25 2007 webthumb-1.01  -rwxr-xr-x 1 root root 3192 Nov 25 2007 webthumb.php  -rw-rw-r-- 1 amrood amrood 20480 Nov 25 2007 webthumb.tar  -rw-rw-r-- 1 amrood amrood 5654 Aug 9 2007 yourfile.mid  -rw-rw-r-- 1 amrood amrood 166255 Aug 9 2007 yourfile.swf  drwxr-xr-x 11 amrood amrood 4096 May 29 2007 zlib-1.2.3
  • 14. echo Command  echo command in linux is used to display line of text/string that are passed as an argument . This is a built-in command that is mostly used in shell scripts and batch files to output status text to the screen or a file.  Syntax :  echo [option] [string]  Displaying a text/string :  Syntax :  echo [string]
  • 15. Printf command  “printf” command in Linux is used to display the given string, number or any other format specifier on the terminal window. It works the same way as “printf” works in programming languages like C.  Syntax:  $printf [-v var] format [arguments]  printf can have format specifiers, escape sequences or ordinary characters.  Format Specifiers: The most commonly used printf specifiers are %s, %b, %d, %x and %f.
  • 16.  %s specifier: It is basically a string specifier for string output.  $printf "%sn" "Hello, World!"  %b specifier: It is same as string specifier, but it allows us to interpret escape sequences with an argument. Input : printf "%bn" "Hello, World! n" "From Geeks For Geeksn" Output: Hello, World! From Geeks For Geeks
  • 17. who command who command is used to find out the following information : 1. Time of last system boot 2. Current run level of the system 3. List of logged in users and more. Description : The who command is used to get information about currently logged in user on to system.  Syntax : $who [options] [filename]
  • 18. Examples :  1. The who command displays the following information for each user currently logged in to the system if no option is provided :  Login name of the users  Terminal line numbers  Login time of the users in to system  Remote host name of the user  hduser@mahesh-Inspiron-3543:~$ who  hduser tty7 2018-03-18 19:08 (:0)  hduser@mahesh-Inspiron-3543:~$
  • 19. Date command  date command is used to display the system date and time. date command is also used to set date and time of the system. By default the date command displays the date in the time zone on which unix/linux operating system is configured.You must be the super-user (root) to change the date and time.  Syntax:  date [OPTION]... [+FORMAT]  Command:  $date  Output:  Tue Oct 10 22:55:01 PDT 2017
  • 20. Passwd command  passwd command in Linux is used to change the user account passwords. The root user reserves the privilege to change the password for any user on the system, while a normal user can only change the account password for his or her own account.  Syntax:  passwd [options] [username]
  • 21. cal command  If a user wants a quick view of calendar in Linux terminal, cal is the command for you. By default, cal command shows current month calendar as output.  cal command is a calendar command in Linux which is used to see the calendar of a specific month or a whole year.  Syntax:  cal [ [ month ] year]  Rectangular bracket means it is optional, so if used without option, it will display a calendar of current month and year.  cal : Shows current month calendar on the terminal
  • 22. Combining commands This will give you a listing of the current directory ( ls ), find out which directory you’re currently in ( pwd ), and display your login name ( whoami ) all at once.
  • 23. The Logical AND Operator (&&)  If you want the second command to only run if the first command is successful, separate the commands with the logical AND operator, which is two ampersands ( && ). For example, we want to make a directory called MyFolder and then change to that directory–provided it was successfully created. So, we type the following on the command line and press Enter.  mkdir MyFolder && cd MyFolder  The folder was successfully created, so the cd command was executed, and we are now in the new folder.
  • 24. Option Three: The Logical OR Operator (||)  Sometimes you might want to execute a second command only if the first command does not succeed. To do this, we use the logical OR operator, or two vertical bars ( || ). For example, we want to check to see if the MyFolder directory exists ( [ -d ~/MyFolder ] ) and create it if it doesn’t ( mkdir ~/MyFolder ). So, we type the following command at the prompt and press Enter.  [ -d ~/MyFolder ] || mkdir ~/MyFolder  Be sure there is a space after the first bracket and before the second bracket or the first command that checks if the directory exists will not work.