SlideShare a Scribd company logo
UNIX Introduction
What is Unix?
 Just like Windows, it is an operating system.
 Linux is one of the popular versions of the UNIX operating system, which is designed to
offer a free or low cost operating system for personal computer users.
 Android is powered by the Linux operating system.
 An operating system is software that manages all of the hardware resources associated
with your desktop or laptop.
 To put it simply, the operating system manages the communication between your
software and your hardware. Without the operating system (OS), the software wouldn't
function.
Why use?
 Does that operating system you are currently using really work ? Or, do you find
yourself battling obstacles like viruses, malware, slow downs, crashes, costly
repairs, and licensing fees?
If you struggle with the above, Unix or its flavour might be the perfect platform for
you.
Combine that reliability with zero cost (Free)of entry and you have the perfect solution
for a desktop platform.
 Open source
 Open source follows these key tenants:
 The freedom to run the program, for any purpose.
 The freedom to study how the program works, and change it to make it do what
you wish.
 The freedom to redistribute copies so you can help your neighbour.
 The freedom to distribute copies of your modified versions to others.
The Linux operating system comprises several
different pieces:
 Bootloader – The software that manages the boot process of your computer. For
most users, this will simply be a splash screen that pops up and eventually goes
away to boot into the operating system.
 Kernel – This is the one piece of the whole that is actually called Unix. The kernel is
the core of the system and manages the CPU, memory, and peripheral devices. The
kernel is the lowest level of the OS.
 Daemons – These are background services (printing, sound, scheduling, etc.) that
either start up during boot or after you log into the desktop.
 etc.
Unix System Architecture
The kernel is the core part of the operating system, which is responsible for all the major
activities of the operating system
 Portable: Unix operating system can work on different types of hardware's as well
as kernel supports the installation of any kind of hardware platform.
 Open Source: Source code of operating system is freely available and, to enhance
the ability of the operating system, many teams work in collaboration.
 Multiuser: It is a multiuser system, which means, multiple users can access the
system resources like RAM, Memory or Application programs at the same time.
 Multiprogramming: It is a multiprogramming system, which means multiple
applications can run at the same time.
 Shell: Unix operating system offers a special interpreter program, that can be used
to execute commands of the OS. It can be used to do several types of operations
like call application programs, and so on.
 Security: Unix operating system offers user security system using authentication
features like controlled access to particular files.
Features of Unix Operating System
Applications
 User Support Tools
 Text processing (vi, sed, awk)
 Productivity applications
 Programmer Support Tools
 Programming languages & compilers (C, C++, Java)
 Shell scripts
 Personal software process: version control
 Source Code Control System (SCCS)
 Revision Control System (RCS)
 Unix as server
 Web server, mail server, application server
Some Unix distributions include:
 Solaris
 AIX
IBM
 HP-UX
 NetBSD
 Xenix
 macOS
UNIX Shells
 sh
 Bourne shell: Steve Bourne, 1978
 Almquist shell (ash): BSD sh replacement
 Bourne-Again shell (bash): GNU/Linux
 csh
 C shell, Bill Joy, BSD, 1978
 tcsh
 Tenex C shell (tcsh): GNU/Linux
 others: Korn shell (ksh), Zshell (zsh), …
Help
 Some web sites
 www.unixtools.com
 www.ugu.com
 www.unix-manuals.com
 www.unixcities.com
 www.tldp.org
 www.linux.com
 www.linux.org
 linux.die.net
The most common Unix/Linux commands
Command Description
cat [filename]
Display file’s contents to the standard output
device
(usually your monitor).
cd /directorypath Change to directory.
chmod [options] mode filename Change a file’s permissions.
chown [options] filename Change who owns a file.
clear
Clear a command line screen/window for a
fresh start.
cp [options] source destination Copy files and directories.
date [options] Display or set the system date and tim
df [options] Display used and available disk space.
du [options] Show how much space each file takes up.
file [options] filename Determine what type of data is within a file.
find [pathname] [expression] Search for files matching a provided pattern.
kill [options] pid
Stop a process. If the process refuses to stop,
use kill -9 pid.
less [options] [filename] View the contents of a file one page at a time.
ln [options] source [destination] Create a shortcut.
locate filename
Search a copy of your filesystem for the
specified
filename.
lpr [options] Send a print job.
ls [options] List directory contents.
man [command]
Display the help information for the specified
command.
mkdir [options] directory Create a new directory.
mv [options] source destination Rename or move file(s) or directories.
passwd [name [password]]
Change the password or allow (for the system
administrator) to
change any password.
ps [options]
Display a snapshot of the currently running
processes.
pwd
Display the pathname for the current
directory.
rm [options] directory Remove (delete) file(s) and/or directories.
rmdir [options] directory Delete empty directories.
ssh [options] user@machine
Remotely log in to another Linux machine,
over the network.
Leave an ssh session by typing exit.
su [options] [user [arguments]] Switch to another user account.
tail [options] [filename]
Display the last n lines of a file (the
default is
10).
tar [options] filename
Store and extract files from a tarfile (.tar)
or tarball (.tar.gz or .tgz).
top
Displays the resources being used on
your system. Press q to
exit.
touch filename
Create an empty file with the specified
name.
who [options] Display who is logged on.
Unix directory structure revisited
'cd ~' change directory to your
home
'cd ~ sonali' change directory to
sonali's home
'cd ..' change directory to upper
directory
'cd / ' change directory to root
Use tabs to complete the file name
(write partial file name and then use
tab)
File Commands
Permissions – important for sharing your
files and restricting access on your work
'chmod 755' => rwx rwx rwx (user
group all)
'chmod a+r' => (u/g/a) ( +/ -) (r/w/x)
‘file’ utility tells type of file like text,
word or pdf
(Helpful when extension is not given)
Important filters-
'grep word path/filename', grep find a
word in a file
pipes ' | ' : redirect output of one
command to other command
'more' or 'less' shows files pagewise
‘find’ and ‘locate’ utility help to find a
file by filename
‘find –r path –name filename’ will find
the location of file in given path.
Useful command as we can use wild
card pattern
File Commands
fast and easy
Basic modes- edit and
command,
‘esc’ for command mode
‘i, a’ for edit mode (insert or
append mode)
Other commands using colon-
:q,:w,:q!,:e
:q for quit, :w for write, :q! quit
without save
:e open another file for editing, :wq
write and quit
Searching using ‘/’
In command mode use ‘/’ then
write the word you want to search
‘n’ for forward search, ‘N’ for
backward search
Search and replace
:s/ram/mohan - will search string
“ram” and replace with “mohan”
Advanced vi – vim(vi improve)
and gvim(gnu vim)
VI EDITOR
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
Discussed in Class in Detail(with
example and diagram):
User File descriptor table( per process)
File table(global kernel structure)
Inode table
Inode in detail:
Process access to data blocks.
Addressing scheme and Calculation.
Unix_Introduction_BCA.pptx the very basi
Discussed in Class in Detail (with algorithm)
File Input output.
Lseek
Other file system calls
Stat()
Fstat()
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
Process:
Def
Process Control System
States : 1-9
Data structures ( with contents of each):
•Process table
•U area
Context of a process
(user context, register, system level)
Context switching and steps
„
System calls:
ƒ
fork() spawns new process
Called once, returns twice
ƒ
exit() terminates own process
ƒ
Called once, never returns
ƒ
Puts it into “zombie” status
ƒ
wait() for terminated children
ƒ
execl() run new program in existing process
ƒ
Pipes, Filters
and Redirection
Redirection
Will use redirection to redirect standard input and standard output.
Operating system gets information from or sends information to:
 Standard input
 Standard output
 Standard error
Redirection
I/O redirection tells OS you want information read from or written to a
device other than the standard ones.
Symbols used for redirection:
 > (greater than)
 < (less than)
 >> (double greater than)
Redirection
 Redirection works with commands that write their results to standard output
device (screen)
 Using >
 COPY can only copy files, not commands
 Using <
 Any input from keyboard ignored if redirection of input is from a file
 Using > between files - first file overwrites second file
 Using >> between files - first file appended to end of second file
Filters
Three filter commands:
 SORT
 FIND
 MORE
Operating system creates temporary files while it “filters” data.
Operating system will not be able to execute filter commands on write-
protected disk.
Filters
SORT filter command:
 Arranges lines of input in ascending order
 Sends output to standard output unless redirected
SORT syntax:
SORT [/R] [/+N] [/M kilobytes] [/L locale] [/REC recordbytes]
[[drive:] [path1] filename1] [/T [drive2:] [path2]] [O [drive3:]
[path3] filename3]
Filters
FIND filter command:
 Allows you to search a file for a specific character string by
enclosing it in quotation marks.
FIND syntax:
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]]“string”
[[drive:] [path] filename[ …]]
FIND command is looking for exact match, therefore, is case sensitive
unless /I parameter
is used.
FIND parameters:
 /I - ignores case
 /V - search a file for anything except what is in quotes
 /N - finds specific line number of each occurrence
 /C - numeric count of number of times specific character string
appears in a file
PIPES
Pipes:
 Standard output of one program used as standard input
to next program
 Used with filter commands to further refine data
 Not limited to two programs
 Pipe symbol is the vertical broken bar | and is used
between two commands.
 Location of the pipe symbol is not standard.
Signals
A signal is a small message that notifies a process that an
event of some type has occurred in the system.
•sent from the kernel (sometimes at the request of another process) to a
process
•signal type is identified by small integer IDs (1‐30)
•only information in a signal is its ID and the fact that it arrived
ID NAME Action Event
2 SIGINT Terminate Interrupt(Ctrl+C)
Sending Signals
Kernel sends (delivers) a signal to a destination process by
updating some state in the context of the destination process
Kernel sends a signal for one of the following reasons:
•ƒ
Kernel has detected a system event such as divide‐by‐zero
(SIGFPE) or
•the termination of a child process (SIGCHLD)
•ƒ
Another process has invoked the kill system call to explicitly request
•the kernel to send a signal to the destination process
A destination process receives a signal when it is forced by the kernel to react in some
way to the delivery of the signal
„Three possible ways to react:
•ƒ
Ignore the signal (do nothing)
•ƒ
Terminate the process (with optional core dump)
•ƒ
Catch the signal by executing a user‐level function called signal handler
ƒ
Akin to a hardware exception handler being called in response to an
asynchronous interrupt
Receiving Signals

More Related Content

Similar to Unix_Introduction_BCA.pptx the very basi (20)

PPSX
Unix environment [autosaved]
Er Mittinpreet Singh
 
PPTX
Network and System Administration Power Point
kemal678348
 
PPTX
Unix / Linux Operating System introduction.
poongothai11
 
PDF
AOS Lab 1: Hello, Linux!
Zubair Nabi
 
DOC
58518522 study-aix
homeworkping3
 
PPTX
Operating System Laboratory presentation .ppt
PDhivyabharathi2
 
PPTX
KMSUnix and Linux.pptx
Ganesh Bhosale
 
PPTX
Unix operating system architecture with file structure
amol_chavan
 
DOC
Linux
Hemakumar.S
 
PPT
PowerPoint_merge.ppt on unix programming
Priyadarshini648418
 
PPT
Karkha unix shell scritping
chockit88
 
PPT
unix.ppt
jeronimored
 
PDF
Unix - An Introduction
Deepanshu Gahlaut
 
PPT
Online Training in Unix Linux Shell Scripting in Hyderabad
Ravikumar Nandigam
 
PPT
Linux Administration
harirxg
 
PPT
Linux Administration
Harish1983
 
PPTX
Unix/Linux
Saurabh Upadhyay
 
PPTX
Shells commands, file structure, directory structure.pptx
SherinRappai
 
PPT
Linux administration classes in mumbai
Vibrant Technologies & Computers
 
PDF
Unix and Linux - The simple introduction
Amity University Noida
 
Unix environment [autosaved]
Er Mittinpreet Singh
 
Network and System Administration Power Point
kemal678348
 
Unix / Linux Operating System introduction.
poongothai11
 
AOS Lab 1: Hello, Linux!
Zubair Nabi
 
58518522 study-aix
homeworkping3
 
Operating System Laboratory presentation .ppt
PDhivyabharathi2
 
KMSUnix and Linux.pptx
Ganesh Bhosale
 
Unix operating system architecture with file structure
amol_chavan
 
PowerPoint_merge.ppt on unix programming
Priyadarshini648418
 
Karkha unix shell scritping
chockit88
 
unix.ppt
jeronimored
 
Unix - An Introduction
Deepanshu Gahlaut
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Ravikumar Nandigam
 
Linux Administration
harirxg
 
Linux Administration
Harish1983
 
Unix/Linux
Saurabh Upadhyay
 
Shells commands, file structure, directory structure.pptx
SherinRappai
 
Linux administration classes in mumbai
Vibrant Technologies & Computers
 
Unix and Linux - The simple introduction
Amity University Noida
 

More from Priyadarshini648418 (12)

PPTX
Process scheduling commands in unix.pptx
Priyadarshini648418
 
PPTX
DBMS_Online database management sys.pptx
Priyadarshini648418
 
PPTX
3. Context of a process in a unix .pptx
Priyadarshini648418
 
PPTX
1 Data Manipulation, data mining techniq
Priyadarshini648418
 
PPT
Applied artificial intelligece of pg.ppt
Priyadarshini648418
 
PPT
AAI expert system and their usecases.ppt
Priyadarshini648418
 
PPTX
deep learn about blood vessel auto1.pptx
Priyadarshini648418
 
PPT
Applied Artificial Intelligence presenttt
Priyadarshini648418
 
PPTX
Nest_Dictionaries in python coding1.pptx
Priyadarshini648418
 
PPTX
Gender Recognition in the voice PPT.pptx
Priyadarshini648418
 
PPTX
Data Science Machine Lerning Bigdat.pptx
Priyadarshini648418
 
PPTX
2. UNIX OS System Architecture easy.pptx
Priyadarshini648418
 
Process scheduling commands in unix.pptx
Priyadarshini648418
 
DBMS_Online database management sys.pptx
Priyadarshini648418
 
3. Context of a process in a unix .pptx
Priyadarshini648418
 
1 Data Manipulation, data mining techniq
Priyadarshini648418
 
Applied artificial intelligece of pg.ppt
Priyadarshini648418
 
AAI expert system and their usecases.ppt
Priyadarshini648418
 
deep learn about blood vessel auto1.pptx
Priyadarshini648418
 
Applied Artificial Intelligence presenttt
Priyadarshini648418
 
Nest_Dictionaries in python coding1.pptx
Priyadarshini648418
 
Gender Recognition in the voice PPT.pptx
Priyadarshini648418
 
Data Science Machine Lerning Bigdat.pptx
Priyadarshini648418
 
2. UNIX OS System Architecture easy.pptx
Priyadarshini648418
 
Ad

Recently uploaded (20)

PPTX
intro-to-accounting-week-1.pptxbahshhahz
matthewEmpleo1
 
PPTX
Adaptive Leadership Model 2025 – AI-Generated PowerPoint by Presentify.ai
presentifyai
 
PPTX
maths analysis saktffy shfshshhhnew.pptx
yuxshanyoga
 
PDF
From-Idea-to-Business-Plan-A-Practical-Guide.pdf
eman youssif
 
PDF
hr generalist training.pdf..............
a25075044
 
PPTX
Using the translanguaging to enhance RES
ssuserb7fdac
 
PDF
Smarter Private Job Search Starts with Formwalaa
Reeshna Prajeesh
 
PPTX
The Future of Law.ppptttttttttttttttttttttttttttttttttttttttttttttttttttttttt...
sahatanmay391
 
PDF
Formwalaa: Your One-Stop Hub for Exam & Job Application Forms
Reeshna Prajeesh
 
PPTX
原版英国牛津大学毕业证(Oxon毕业证书)如何办理
Taqyea
 
PPTX
STATE OFFICERS for organization reference
conqueror3rd
 
PPTX
Plant Growth and Development-Part I, ppt.pptx
7300511143
 
PDF
ILLUMINATI CALL KAMPALA IN UGANDA+256776963507/0741506136
Illuminati Agent in Kampala Uganda+256776963507/0741506136
 
PPTX
Student_Support_Services_Presentation.pptx
Muhammad439928
 
PDF
Walking &Working Surfaces – Stairs & Ladders.pdf
دكتور تامر عبدالله شراكى
 
PPTX
A Guide for a Winning Interview July 2025
Bruce Bennett
 
PDF
hr generalist certification.pdf.........
a25075044
 
PDF
Sarkari Job Alerts in Marathi & English – Majhi Naukri
Reeshna Prajeesh
 
PDF
corporate training firms in pune.........
a25075044
 
PPTX
21st-Literature.pptxjsududhshsusushshsusuhsgsysh
JohnVJLBellen
 
intro-to-accounting-week-1.pptxbahshhahz
matthewEmpleo1
 
Adaptive Leadership Model 2025 – AI-Generated PowerPoint by Presentify.ai
presentifyai
 
maths analysis saktffy shfshshhhnew.pptx
yuxshanyoga
 
From-Idea-to-Business-Plan-A-Practical-Guide.pdf
eman youssif
 
hr generalist training.pdf..............
a25075044
 
Using the translanguaging to enhance RES
ssuserb7fdac
 
Smarter Private Job Search Starts with Formwalaa
Reeshna Prajeesh
 
The Future of Law.ppptttttttttttttttttttttttttttttttttttttttttttttttttttttttt...
sahatanmay391
 
Formwalaa: Your One-Stop Hub for Exam & Job Application Forms
Reeshna Prajeesh
 
原版英国牛津大学毕业证(Oxon毕业证书)如何办理
Taqyea
 
STATE OFFICERS for organization reference
conqueror3rd
 
Plant Growth and Development-Part I, ppt.pptx
7300511143
 
ILLUMINATI CALL KAMPALA IN UGANDA+256776963507/0741506136
Illuminati Agent in Kampala Uganda+256776963507/0741506136
 
Student_Support_Services_Presentation.pptx
Muhammad439928
 
Walking &Working Surfaces – Stairs & Ladders.pdf
دكتور تامر عبدالله شراكى
 
A Guide for a Winning Interview July 2025
Bruce Bennett
 
hr generalist certification.pdf.........
a25075044
 
Sarkari Job Alerts in Marathi & English – Majhi Naukri
Reeshna Prajeesh
 
corporate training firms in pune.........
a25075044
 
21st-Literature.pptxjsududhshsusushshsusuhsgsysh
JohnVJLBellen
 
Ad

Unix_Introduction_BCA.pptx the very basi

  • 2. What is Unix?  Just like Windows, it is an operating system.  Linux is one of the popular versions of the UNIX operating system, which is designed to offer a free or low cost operating system for personal computer users.  Android is powered by the Linux operating system.  An operating system is software that manages all of the hardware resources associated with your desktop or laptop.  To put it simply, the operating system manages the communication between your software and your hardware. Without the operating system (OS), the software wouldn't function.
  • 3. Why use?  Does that operating system you are currently using really work ? Or, do you find yourself battling obstacles like viruses, malware, slow downs, crashes, costly repairs, and licensing fees? If you struggle with the above, Unix or its flavour might be the perfect platform for you. Combine that reliability with zero cost (Free)of entry and you have the perfect solution for a desktop platform.  Open source  Open source follows these key tenants:  The freedom to run the program, for any purpose.  The freedom to study how the program works, and change it to make it do what you wish.  The freedom to redistribute copies so you can help your neighbour.  The freedom to distribute copies of your modified versions to others.
  • 4. The Linux operating system comprises several different pieces:  Bootloader – The software that manages the boot process of your computer. For most users, this will simply be a splash screen that pops up and eventually goes away to boot into the operating system.  Kernel – This is the one piece of the whole that is actually called Unix. The kernel is the core of the system and manages the CPU, memory, and peripheral devices. The kernel is the lowest level of the OS.  Daemons – These are background services (printing, sound, scheduling, etc.) that either start up during boot or after you log into the desktop.  etc.
  • 5. Unix System Architecture The kernel is the core part of the operating system, which is responsible for all the major activities of the operating system
  • 6.  Portable: Unix operating system can work on different types of hardware's as well as kernel supports the installation of any kind of hardware platform.  Open Source: Source code of operating system is freely available and, to enhance the ability of the operating system, many teams work in collaboration.  Multiuser: It is a multiuser system, which means, multiple users can access the system resources like RAM, Memory or Application programs at the same time.  Multiprogramming: It is a multiprogramming system, which means multiple applications can run at the same time.  Shell: Unix operating system offers a special interpreter program, that can be used to execute commands of the OS. It can be used to do several types of operations like call application programs, and so on.  Security: Unix operating system offers user security system using authentication features like controlled access to particular files. Features of Unix Operating System
  • 7. Applications  User Support Tools  Text processing (vi, sed, awk)  Productivity applications  Programmer Support Tools  Programming languages & compilers (C, C++, Java)  Shell scripts  Personal software process: version control  Source Code Control System (SCCS)  Revision Control System (RCS)  Unix as server  Web server, mail server, application server
  • 8. Some Unix distributions include:  Solaris  AIX IBM  HP-UX  NetBSD  Xenix  macOS
  • 9. UNIX Shells  sh  Bourne shell: Steve Bourne, 1978  Almquist shell (ash): BSD sh replacement  Bourne-Again shell (bash): GNU/Linux  csh  C shell, Bill Joy, BSD, 1978  tcsh  Tenex C shell (tcsh): GNU/Linux  others: Korn shell (ksh), Zshell (zsh), …
  • 10. Help  Some web sites  www.unixtools.com  www.ugu.com  www.unix-manuals.com  www.unixcities.com  www.tldp.org  www.linux.com  www.linux.org  linux.die.net
  • 11. The most common Unix/Linux commands Command Description cat [filename] Display file’s contents to the standard output device (usually your monitor). cd /directorypath Change to directory. chmod [options] mode filename Change a file’s permissions. chown [options] filename Change who owns a file. clear Clear a command line screen/window for a fresh start. cp [options] source destination Copy files and directories. date [options] Display or set the system date and tim
  • 12. df [options] Display used and available disk space. du [options] Show how much space each file takes up. file [options] filename Determine what type of data is within a file. find [pathname] [expression] Search for files matching a provided pattern. kill [options] pid Stop a process. If the process refuses to stop, use kill -9 pid. less [options] [filename] View the contents of a file one page at a time. ln [options] source [destination] Create a shortcut. locate filename Search a copy of your filesystem for the specified filename. lpr [options] Send a print job. ls [options] List directory contents.
  • 13. man [command] Display the help information for the specified command. mkdir [options] directory Create a new directory. mv [options] source destination Rename or move file(s) or directories. passwd [name [password]] Change the password or allow (for the system administrator) to change any password. ps [options] Display a snapshot of the currently running processes. pwd Display the pathname for the current directory. rm [options] directory Remove (delete) file(s) and/or directories. rmdir [options] directory Delete empty directories. ssh [options] user@machine Remotely log in to another Linux machine, over the network. Leave an ssh session by typing exit.
  • 14. su [options] [user [arguments]] Switch to another user account. tail [options] [filename] Display the last n lines of a file (the default is 10). tar [options] filename Store and extract files from a tarfile (.tar) or tarball (.tar.gz or .tgz). top Displays the resources being used on your system. Press q to exit. touch filename Create an empty file with the specified name. who [options] Display who is logged on.
  • 15. Unix directory structure revisited 'cd ~' change directory to your home 'cd ~ sonali' change directory to sonali's home 'cd ..' change directory to upper directory 'cd / ' change directory to root Use tabs to complete the file name (write partial file name and then use tab) File Commands
  • 16. Permissions – important for sharing your files and restricting access on your work 'chmod 755' => rwx rwx rwx (user group all) 'chmod a+r' => (u/g/a) ( +/ -) (r/w/x) ‘file’ utility tells type of file like text, word or pdf (Helpful when extension is not given) Important filters- 'grep word path/filename', grep find a word in a file pipes ' | ' : redirect output of one command to other command 'more' or 'less' shows files pagewise ‘find’ and ‘locate’ utility help to find a file by filename ‘find –r path –name filename’ will find the location of file in given path. Useful command as we can use wild card pattern File Commands
  • 17. fast and easy Basic modes- edit and command, ‘esc’ for command mode ‘i, a’ for edit mode (insert or append mode) Other commands using colon- :q,:w,:q!,:e :q for quit, :w for write, :q! quit without save :e open another file for editing, :wq write and quit Searching using ‘/’ In command mode use ‘/’ then write the word you want to search ‘n’ for forward search, ‘N’ for backward search Search and replace :s/ram/mohan - will search string “ram” and replace with “mohan” Advanced vi – vim(vi improve) and gvim(gnu vim) VI EDITOR
  • 21. Discussed in Class in Detail(with example and diagram): User File descriptor table( per process) File table(global kernel structure) Inode table Inode in detail: Process access to data blocks. Addressing scheme and Calculation.
  • 23. Discussed in Class in Detail (with algorithm) File Input output. Lseek Other file system calls Stat() Fstat()
  • 27. Process: Def Process Control System States : 1-9 Data structures ( with contents of each): •Process table •U area Context of a process (user context, register, system level) Context switching and steps
  • 28. „ System calls: ƒ fork() spawns new process Called once, returns twice ƒ exit() terminates own process ƒ Called once, never returns ƒ Puts it into “zombie” status ƒ wait() for terminated children ƒ execl() run new program in existing process ƒ
  • 30. Redirection Will use redirection to redirect standard input and standard output. Operating system gets information from or sends information to:  Standard input  Standard output  Standard error
  • 31. Redirection I/O redirection tells OS you want information read from or written to a device other than the standard ones. Symbols used for redirection:  > (greater than)  < (less than)  >> (double greater than)
  • 32. Redirection  Redirection works with commands that write their results to standard output device (screen)  Using >  COPY can only copy files, not commands  Using <  Any input from keyboard ignored if redirection of input is from a file  Using > between files - first file overwrites second file  Using >> between files - first file appended to end of second file
  • 33. Filters Three filter commands:  SORT  FIND  MORE Operating system creates temporary files while it “filters” data. Operating system will not be able to execute filter commands on write- protected disk.
  • 34. Filters SORT filter command:  Arranges lines of input in ascending order  Sends output to standard output unless redirected SORT syntax: SORT [/R] [/+N] [/M kilobytes] [/L locale] [/REC recordbytes] [[drive:] [path1] filename1] [/T [drive2:] [path2]] [O [drive3:] [path3] filename3]
  • 35. Filters FIND filter command:  Allows you to search a file for a specific character string by enclosing it in quotation marks. FIND syntax: FIND [/V] [/C] [/N] [/I] [/OFF[LINE]]“string” [[drive:] [path] filename[ …]] FIND command is looking for exact match, therefore, is case sensitive unless /I parameter is used. FIND parameters:  /I - ignores case  /V - search a file for anything except what is in quotes  /N - finds specific line number of each occurrence  /C - numeric count of number of times specific character string appears in a file
  • 36. PIPES Pipes:  Standard output of one program used as standard input to next program  Used with filter commands to further refine data  Not limited to two programs  Pipe symbol is the vertical broken bar | and is used between two commands.  Location of the pipe symbol is not standard.
  • 37. Signals A signal is a small message that notifies a process that an event of some type has occurred in the system. •sent from the kernel (sometimes at the request of another process) to a process •signal type is identified by small integer IDs (1‐30) •only information in a signal is its ID and the fact that it arrived ID NAME Action Event 2 SIGINT Terminate Interrupt(Ctrl+C)
  • 38. Sending Signals Kernel sends (delivers) a signal to a destination process by updating some state in the context of the destination process Kernel sends a signal for one of the following reasons: •ƒ Kernel has detected a system event such as divide‐by‐zero (SIGFPE) or •the termination of a child process (SIGCHLD) •ƒ Another process has invoked the kill system call to explicitly request •the kernel to send a signal to the destination process
  • 39. A destination process receives a signal when it is forced by the kernel to react in some way to the delivery of the signal „Three possible ways to react: •ƒ Ignore the signal (do nothing) •ƒ Terminate the process (with optional core dump) •ƒ Catch the signal by executing a user‐level function called signal handler ƒ Akin to a hardware exception handler being called in response to an asynchronous interrupt Receiving Signals