SlideShare a Scribd company logo
Handled By
X. IGNATIUS SELVARANI,
AP/IT
OPERATING SYSTEM
An Operating System is a set of programs that
 Functions as an virtual machine by presenting an
interface that is easier to program than the underlying
hardware
 Acts as resource management through orderly and
controlled allocation of the processors, memories,
and I/O devices among the programs competing for it.
ORGANIZATION OF UNIX
The UNIX system is functionally organized at three
levels and are:
1. The kernel, which schedules tasks and manages
storage;
2. The shell, which connects and interprets users'
commands, calls programs from memory, and executes
them; and
3. The tools and applications that offer additional
functionality to the OS
UNIX Structure
HARDWARE AND SOFTWARE REQUIREMENTS
Hardware requirements
 Processor : Pentium III / Pentium 4/M or equivalent
 RAM : 256 MB to 1GB
 Disk space : 500MB to 5GB
Software requirements
 Operating System : Windows XP /Vista/2003/2008
 Languages : C/C++
PuTTY
 PuTTY is a free and open-source terminal emulator.
 The name "PuTTY" has no official meaning. PuTTY
was originally written for Microsoft Windows, but it
has been ported to various other operating systems.
 PuTTY is the most used SSH client for the Microsoft
Windows platform.
 The SSH protocol was developed as a secure,
encrypted replacement for the RSH protocol.
 PuTTY is a very versatile tool for remote access to
another computer. It's probably used more often by
people who want secure remote shell access to a UNIX
or Linux system than for any other purpose
COURSE OBJECTIVES
 To learn Unix commands and shell programming
 To implement various CPU Scheduling Algorithms
 To implement Process Creation and Inter Process
Communication.
 To implement Deadlock Avoidance and Deadlock
Detection Algorithms
 To implement Page Replacement Algorithms
 To implement File Organization and File Allocation
Strategies
LIST OF EXPERIMENTS
1. Basics of UNIX commands
2. Write programs using the following system calls of UNIX
operating system fork, exec, getpid, exit, wait, close, stat,
opendir, readdir
3. Write C programs to simulate UNIX commands like cp,
ls, grep, etc.
4. Shell Programming
5. Write C programs to implement the various CPU
Scheduling Algorithms
6. Implementation of Semaphores
7. Implementation of Shared memory and IPC
8. Bankers Algorithm for Deadlock Avoidance
9. Implementation of Deadlock Detection Algorithm
LIST OF EXPERIMENTS (Contd..)
10. Write C program to implement Threading &
Synchronization Applications
11. Implementation of the following Memory Allocation
Methods for fixed partition
a) First Fit b) Worst Fit c) Best Fit
12. Implementation of Paging Technique of Memory
Management
13. Implementation of the following Page Replacement
Algorithms a) FIFO b) LRU c) LFU
14. Implementation of the various File Organization
Techniques
15. Implementation of the following File Allocation
Strategies
a) Sequential b) Indexed c) Linked
Basics of UNIX commands
Command Function
date Used to display the current system date and time.
date +%D Displays date only
date +%T Displays time only
date +% Y Displays the year part of date
date +% H Displays the hour part of time
cal Calendar of the current month
Cal year Displays calendar for all months of the specified year
Command Function
who
Login details of all users such as their IP, Terminal No, User
name,
who am i Used to display the login details of the user
tty Used to display the terminal name
uname Displays the Operating System
echo "txt" Displays the given text on the screen
echo $HOME Displays the user's home directory
bc Basic calculator. Press Ctrl+d to quit
mancmdname Manual for the given command. Press q to exit
history To display the commands used by the user since log on.
exit Exit from a process. If shell is the only process then logs out
Directory commands
Command Function
pwd Path of the present working directory
mkdirdir A directory is created in the given name under the current
directory
mkdirdir1 dir2 A number of sub-directories can be created under one stroke
cdsubdir Change Directory. If the subdir starts with / then path starts
from root (absolute) otherwise from current working directory.
cd To switch to the home directory.
cd / To switch to the root directory.
cd .. To move back to the parent directory
rmdirsubdir Removes an empty sub-directory.
File commands
Command Function
cat >filename To create a file with some contents. To end typing press Ctrl+d.
The > symbol means redirecting output to a file. (< for input)
catfilename Displays the file contents.
cat >>filename Used to append contents to a file
cpsrc des Copy files to given location. If already exists, it will be overwritten
cp -isrc des Warns the user prior to overwriting the destination file
cp -r src des Copies the entire directory, all its sub-directories and files.
mv old new To rename an existing file or directory. -ioption can also be used
mvf1 f2 f3 dir To move a group of files to a directory.
mv -v old new Display name of each file as it is moved.
File commands (Contd..)
Command Function
rm file Used to delete a file or group of files. -ioption can also be used
rm * To delete all the files in the directory.
rm -r * Deletes all files and sub-directories
rm -f * To forcibly remove even write-protected files
ls Lists all files and subdirectories (blue colored) in sorted manner.
lsname To check whether a file or directory exists.
lsname* Short-hand notation to list out filenames of a specific pattern.
ls -a Lists all files including hidden files (files beginning with .)
ls -xdirname To have specific listing of a directory.
ls -R Recursive listing of all files in the subdirectories
ls -l Long listing showing file access rights (read/write/execute-rwx for
user/group/others-ugo).
cmpfile1 file2 Used to compare two files. Displays nothing if files are identical.
wcfile It produces a statistics of lines (l), words(w), and characters(c).
Vi Editor
 Unix provides a versatile editor vi, a full-screen editor.
vi" stands for visual editor. A vi session begins by
invoking vi with or without a filename.
 $vi filename
 vi functions in three modes namely:
1. Input mode—Where any key depressed is entered as
text
2. Command mode—Where keys are used as
commands to act on text (initial mode)
3. ex mode—ex mode commands that can be entered in
the last line to act on text
Operating System Laboratory presentation .ppt
INPUT MODE
vi starts with command mode. To insert text any of the
following commands should be used.
Commands Function
i Inserts text to the left of the cursor.
I Inserts text at the beginning of line.
a Appends text to right of cursor
A Appends text at end of line
In Input mode the editor displays INSERT in the last
line. Press Enter key to start a fresh line of text in Input
mode and the ~ disappears. To quit input mode press
Esc key.
COMMAND MODE
EDIT COMMANDS
Command Function
s Deletes a single character to the left and switches to Input
mode.
x Deletes the character in the current cursor position
Uor u Reverses the last change made to the buffer.
dd Cuts the entire line
dw Cuts the entire word
d$ Cuts a line from cursor position to the end of the line
d0 Cuts from the cursor position to the start of the line
yy Copies (yanks) the entire line
yw Copies the entire word
p Pastes the text
NAVIGATION COMMANDS
Command Function
b Moves back to beginning of a word
w Moves forward to beginning of word
k Up one line
j Down one line
h Left one character
l Right one character
Ctrl+f Scrolls a page forward
Ctrl+b Scrolls a page backward
THE EX MODE
 The essential save and exit commands form the
features of ex mode. Press : (colon) in command
mode to switch to ex mode. The : is displayed in the
last line. Type the command and press Enter key to
execute the same.
Command Function
w Saves file, displays the number of lines & characters and returns
toInput mode. If it is an unnamed file then vi puts a message.
w file The file is saved under the given name
q Quits vi session and returns to $ prompt. vi has a safety mechanism
that warns if changes made to file are not saved.
q! Quits vi session without saving any changes made since the last save
wq Save and exit
sh Escape to shell
r file To insert another file into the current file.
new file Splits screen into multiple windows and opens the file.
Ad

More Related Content

Similar to Operating System Laboratory presentation .ppt (20)

Linux administration training
Linux administration trainingLinux administration training
Linux administration training
iman darabi
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
vamsikrishna204239
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
vamsikrishna204239
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
rajikaa
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
PrashantTechment
 
58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
homeworkping3
 
Unix
UnixUnix
Unix
Thesis Scientist Private Limited
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Linux basic
Linux basicLinux basic
Linux basic
Pragyagupta37
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
harirxg
 
Linux Notes-1.pdf
Linux Notes-1.pdfLinux Notes-1.pdf
Linux Notes-1.pdf
asif64436
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
Teja Bheemanapally
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
Teja Bheemanapally
 
Kali Linux Commands PDF-converted.pdf
Kali Linux Commands PDF-converted.pdfKali Linux Commands PDF-converted.pdf
Kali Linux Commands PDF-converted.pdf
Casa Vista Properties
 
Kali linux commands
Kali linux commandsKali linux commands
Kali linux commands
Jubair Ahmed Junjun
 
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
 
Linux commands
Linux commandsLinux commands
Linux commands
Meenu Chopra
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptx
SaileshB5
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
banubabitha
 

Recently uploaded (20)

HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Ad

Operating System Laboratory presentation .ppt

  • 1. Handled By X. IGNATIUS SELVARANI, AP/IT
  • 2. OPERATING SYSTEM An Operating System is a set of programs that  Functions as an virtual machine by presenting an interface that is easier to program than the underlying hardware  Acts as resource management through orderly and controlled allocation of the processors, memories, and I/O devices among the programs competing for it.
  • 3. ORGANIZATION OF UNIX The UNIX system is functionally organized at three levels and are: 1. The kernel, which schedules tasks and manages storage; 2. The shell, which connects and interprets users' commands, calls programs from memory, and executes them; and 3. The tools and applications that offer additional functionality to the OS
  • 5. HARDWARE AND SOFTWARE REQUIREMENTS Hardware requirements  Processor : Pentium III / Pentium 4/M or equivalent  RAM : 256 MB to 1GB  Disk space : 500MB to 5GB Software requirements  Operating System : Windows XP /Vista/2003/2008  Languages : C/C++
  • 6. PuTTY  PuTTY is a free and open-source terminal emulator.  The name "PuTTY" has no official meaning. PuTTY was originally written for Microsoft Windows, but it has been ported to various other operating systems.  PuTTY is the most used SSH client for the Microsoft Windows platform.  The SSH protocol was developed as a secure, encrypted replacement for the RSH protocol.  PuTTY is a very versatile tool for remote access to another computer. It's probably used more often by people who want secure remote shell access to a UNIX or Linux system than for any other purpose
  • 7. COURSE OBJECTIVES  To learn Unix commands and shell programming  To implement various CPU Scheduling Algorithms  To implement Process Creation and Inter Process Communication.  To implement Deadlock Avoidance and Deadlock Detection Algorithms  To implement Page Replacement Algorithms  To implement File Organization and File Allocation Strategies
  • 8. LIST OF EXPERIMENTS 1. Basics of UNIX commands 2. Write programs using the following system calls of UNIX operating system fork, exec, getpid, exit, wait, close, stat, opendir, readdir 3. Write C programs to simulate UNIX commands like cp, ls, grep, etc. 4. Shell Programming 5. Write C programs to implement the various CPU Scheduling Algorithms 6. Implementation of Semaphores 7. Implementation of Shared memory and IPC 8. Bankers Algorithm for Deadlock Avoidance 9. Implementation of Deadlock Detection Algorithm
  • 9. LIST OF EXPERIMENTS (Contd..) 10. Write C program to implement Threading & Synchronization Applications 11. Implementation of the following Memory Allocation Methods for fixed partition a) First Fit b) Worst Fit c) Best Fit 12. Implementation of Paging Technique of Memory Management 13. Implementation of the following Page Replacement Algorithms a) FIFO b) LRU c) LFU 14. Implementation of the various File Organization Techniques 15. Implementation of the following File Allocation Strategies a) Sequential b) Indexed c) Linked
  • 10. Basics of UNIX commands Command Function date Used to display the current system date and time. date +%D Displays date only date +%T Displays time only date +% Y Displays the year part of date date +% H Displays the hour part of time cal Calendar of the current month Cal year Displays calendar for all months of the specified year
  • 11. Command Function who Login details of all users such as their IP, Terminal No, User name, who am i Used to display the login details of the user tty Used to display the terminal name uname Displays the Operating System echo "txt" Displays the given text on the screen echo $HOME Displays the user's home directory bc Basic calculator. Press Ctrl+d to quit mancmdname Manual for the given command. Press q to exit history To display the commands used by the user since log on. exit Exit from a process. If shell is the only process then logs out
  • 12. Directory commands Command Function pwd Path of the present working directory mkdirdir A directory is created in the given name under the current directory mkdirdir1 dir2 A number of sub-directories can be created under one stroke cdsubdir Change Directory. If the subdir starts with / then path starts from root (absolute) otherwise from current working directory. cd To switch to the home directory. cd / To switch to the root directory. cd .. To move back to the parent directory rmdirsubdir Removes an empty sub-directory.
  • 13. File commands Command Function cat >filename To create a file with some contents. To end typing press Ctrl+d. The > symbol means redirecting output to a file. (< for input) catfilename Displays the file contents. cat >>filename Used to append contents to a file cpsrc des Copy files to given location. If already exists, it will be overwritten cp -isrc des Warns the user prior to overwriting the destination file cp -r src des Copies the entire directory, all its sub-directories and files. mv old new To rename an existing file or directory. -ioption can also be used mvf1 f2 f3 dir To move a group of files to a directory. mv -v old new Display name of each file as it is moved.
  • 14. File commands (Contd..) Command Function rm file Used to delete a file or group of files. -ioption can also be used rm * To delete all the files in the directory. rm -r * Deletes all files and sub-directories rm -f * To forcibly remove even write-protected files ls Lists all files and subdirectories (blue colored) in sorted manner. lsname To check whether a file or directory exists. lsname* Short-hand notation to list out filenames of a specific pattern. ls -a Lists all files including hidden files (files beginning with .) ls -xdirname To have specific listing of a directory. ls -R Recursive listing of all files in the subdirectories ls -l Long listing showing file access rights (read/write/execute-rwx for user/group/others-ugo). cmpfile1 file2 Used to compare two files. Displays nothing if files are identical. wcfile It produces a statistics of lines (l), words(w), and characters(c).
  • 15. Vi Editor  Unix provides a versatile editor vi, a full-screen editor. vi" stands for visual editor. A vi session begins by invoking vi with or without a filename.  $vi filename  vi functions in three modes namely: 1. Input mode—Where any key depressed is entered as text 2. Command mode—Where keys are used as commands to act on text (initial mode) 3. ex mode—ex mode commands that can be entered in the last line to act on text
  • 17. INPUT MODE vi starts with command mode. To insert text any of the following commands should be used. Commands Function i Inserts text to the left of the cursor. I Inserts text at the beginning of line. a Appends text to right of cursor A Appends text at end of line In Input mode the editor displays INSERT in the last line. Press Enter key to start a fresh line of text in Input mode and the ~ disappears. To quit input mode press Esc key.
  • 18. COMMAND MODE EDIT COMMANDS Command Function s Deletes a single character to the left and switches to Input mode. x Deletes the character in the current cursor position Uor u Reverses the last change made to the buffer. dd Cuts the entire line dw Cuts the entire word d$ Cuts a line from cursor position to the end of the line d0 Cuts from the cursor position to the start of the line yy Copies (yanks) the entire line yw Copies the entire word p Pastes the text
  • 19. NAVIGATION COMMANDS Command Function b Moves back to beginning of a word w Moves forward to beginning of word k Up one line j Down one line h Left one character l Right one character Ctrl+f Scrolls a page forward Ctrl+b Scrolls a page backward
  • 20. THE EX MODE  The essential save and exit commands form the features of ex mode. Press : (colon) in command mode to switch to ex mode. The : is displayed in the last line. Type the command and press Enter key to execute the same. Command Function w Saves file, displays the number of lines & characters and returns toInput mode. If it is an unnamed file then vi puts a message. w file The file is saved under the given name q Quits vi session and returns to $ prompt. vi has a safety mechanism that warns if changes made to file are not saved. q! Quits vi session without saving any changes made since the last save wq Save and exit sh Escape to shell r file To insert another file into the current file. new file Splits screen into multiple windows and opens the file.