SlideShare a Scribd company logo
1 of 18
Unix Shell Scripting
Unix Special Characters
  ( ; # $ ? & * ( ) [ ] ` ‘ “ +
Shells
 A shell is an environment in which we can run our commands, programs, and shell scripts.
 Korn Shell /bin/ksh OR /usr/bin/ksh
 A shell script can be executed in the following ways:
 ksh shell_script_name
 will create a Korn shell and execute the shell_script_name in the newly created Korn shell
environment. shell_script_name.
Different Types of Shells to Declare
#!/usr/bin/sh OR #!/bin/sh Declares a Bourne shell
#!/usr/bin/ksh OR #!/bin/ksh Declares a Korn shell
#!/usr/bin/csh OR #!/bin/csh Declares a C shell
#!/usr/bin/bash OR #!/bin/bash Declares a Bourne-Again shell
Control Structures
 The following control structures will be used extensively.
 if ... then Statement
 if [ test_command ]
 then
 commands
 fi
 if ... then ... else Statement
 if [ test_command ]
 then
 commands
 else
 commands
 fi
 if ... then ... elif ... (else) Statement
 if [ test_command ]
 then
 commands
 elif [ test_command ]
 then
 commands
 elif [ test_command ]
 Then
 commands
 .
 .
 .
 else (Optional)
 commands
 fi
 for ... in Statement
 for loop_variable in argument_list
 do
 commands
 done
 while Statement
 while test_command_is_true
 do
 commands
 done
 until Statement
 until test_command_is_true
 Do
 commands
 done
 case Statement
 case $variable in
 match_1)
 commands_to_execute_for_1
 ;;
 match_2)
 commands_to_execute_for_2
 ;;
 match_3)
 commands_to_execute_for_3
 ;;
 .
 .
 .
 *) (Optional - any other value)
 commands_to_execute_for_no_match
 ;;
 esac
 The last part of the case statement:
 *)
 commands_to_execute_for_no_match
 ;;
 is optional.
Using break, continue, exit, and return
 It is sometimes necessary to break out of a for or while loop, continue in the next block of
code, exit completely out of the script, or return a function’s result back to the script that
called the function.break is used to terminate the execution of the entire loop, after
completing the execution of all of the lines of code up to the break statement. It then
steps down to the code following the end of the loop.continue is used to transfer control
to the next set of code, but it continues execution of the loop.exit will do just what one
would expect: It exits the entire script. An integer may be added to an exit command (for
example, exit 0), which will be sent as the return code.return is used in a function to send
data back, or return a result, to the calling script.
Unix Commands Review
COMMAND DESCRIPTION
passwd Change user password
pwd Print current directory
cd Change directory
ls List of files in a directory
wildcards * matches any number of characters, ?
matches a single
character
file Print the type of file
cat Display the contents of a file
pr Display the contents of a file
pg or page Display the contents of a file one page at a
time
Unix Commands Review (Cond…)
more Display the contents of a file one page at a
time
clear Clear the screen
cp or copy Copy a file
chown Change the owner of a file
chgrp Change the group of a file
chmod Change file modes, permissions
rm Remove a file from the system
mv Rename a file
mkdir Create a directory
rmdir Remove a directory
Unix Commands Review (Cond…)
grep Pattern matching
egrep grep command for extended regular expressions
find Used to locate files and directories
>> Append to the end of a file
> Redirect, create, or overwrite a file
| Pipe, used to string commands together
|| Logical OR—command1 || command2—
execute command2
if command1 fails
& Execute in background
&& Logical AND—command1 && command2—
execute
command2 if command1 succeeds

More Related Content

What's hot

system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarGauravRaikar3
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell ScriptingRaghu nath
 
Linux shell env
Linux shell envLinux shell env
Linux shell envRahul Pola
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.pptKalkey
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shellroot_fibo
 
Unit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptUnit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptroot_fibo
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editorroot_fibo
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash scriptSimon Su
 

What's hot (20)

system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Linux shell env
Linux shell envLinux shell env
Linux shell env
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
 
Chap06
Chap06Chap06
Chap06
 
Unit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptUnit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell script
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editor
 
Intro commandline
Intro commandlineIntro commandline
Intro commandline
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
unix-OS-Lab-4.doc
unix-OS-Lab-4.docunix-OS-Lab-4.doc
unix-OS-Lab-4.doc
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 

Viewers also liked

Diagnostics of a Linux System
Diagnostics of a Linux SystemDiagnostics of a Linux System
Diagnostics of a Linux SystemNovell
 
Oracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting MethodologyOracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting MethodologyRevelation Technologies
 
eScience, Education and Knowledge Management
eScience, Education and Knowledge ManagementeScience, Education and Knowledge Management
eScience, Education and Knowledge ManagementLeo Plugge
 
Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0
Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0
Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0Peter H. Reiser
 
Duncan Allen :: Supporting Healthcare Systems Interoperability
Duncan Allen :: Supporting Healthcare Systems InteroperabilityDuncan Allen :: Supporting Healthcare Systems Interoperability
Duncan Allen :: Supporting Healthcare Systems Interoperabilitygeorge.james
 
Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...
Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...
Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...HFG Project
 
Dhis2 android user_man
Dhis2 android user_manDhis2 android user_man
Dhis2 android user_manEliot Kalenga
 
Methodology Of Enterprise Applications Capacity Planning
Methodology Of Enterprise Applications Capacity PlanningMethodology Of Enterprise Applications Capacity Planning
Methodology Of Enterprise Applications Capacity PlanningLeonid Grinshpan, Ph.D.
 
Responsive Design and Information Architecture with Oracle Web Center Content...
Responsive Design and Information Architecture with Oracle Web Center Content...Responsive Design and Information Architecture with Oracle Web Center Content...
Responsive Design and Information Architecture with Oracle Web Center Content...Dmitri Khanine
 
PEPFAR’s DATIM4U and Associated Interoperability Components
PEPFAR’s DATIM4U and Associated Interoperability ComponentsPEPFAR’s DATIM4U and Associated Interoperability Components
PEPFAR’s DATIM4U and Associated Interoperability ComponentsMEASURE Evaluation
 
Health Information System: Interoperability and Integration to Maximize Effec...
Health Information System: Interoperability and Integration to Maximize Effec...Health Information System: Interoperability and Integration to Maximize Effec...
Health Information System: Interoperability and Integration to Maximize Effec...MEASURE Evaluation
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsYogiji Creations
 
Database Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant ArchitectureDatabase Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant ArchitecturePini Dibask
 
OOW09 Integration Architecture EBS R12
OOW09 Integration Architecture  EBS R12OOW09 Integration Architecture  EBS R12
OOW09 Integration Architecture EBS R12jucaab
 
Fusion Middleware Oracle Data Integrator
Fusion Middleware Oracle Data IntegratorFusion Middleware Oracle Data Integrator
Fusion Middleware Oracle Data IntegratorMark Rabne
 
Trouble shoot with linux syslog
Trouble shoot with linux syslogTrouble shoot with linux syslog
Trouble shoot with linux syslogashok191
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanshipbokonen
 

Viewers also liked (20)

Diagnostics of a Linux System
Diagnostics of a Linux SystemDiagnostics of a Linux System
Diagnostics of a Linux System
 
Oracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting MethodologyOracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting Methodology
 
eScience, Education and Knowledge Management
eScience, Education and Knowledge ManagementeScience, Education and Knowledge Management
eScience, Education and Knowledge Management
 
Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0
Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0
Building Vibrant Communities - Erfolgreiche Einführung von Enterprise 2.0
 
Duncan Allen :: Supporting Healthcare Systems Interoperability
Duncan Allen :: Supporting Healthcare Systems InteroperabilityDuncan Allen :: Supporting Healthcare Systems Interoperability
Duncan Allen :: Supporting Healthcare Systems Interoperability
 
Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...
Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...
Improving Data for Decision-Making: Leveraging Data Quality Audits in Haryana...
 
Dhis2 android user_man
Dhis2 android user_manDhis2 android user_man
Dhis2 android user_man
 
Methodology Of Enterprise Applications Capacity Planning
Methodology Of Enterprise Applications Capacity PlanningMethodology Of Enterprise Applications Capacity Planning
Methodology Of Enterprise Applications Capacity Planning
 
Responsive Design and Information Architecture with Oracle Web Center Content...
Responsive Design and Information Architecture with Oracle Web Center Content...Responsive Design and Information Architecture with Oracle Web Center Content...
Responsive Design and Information Architecture with Oracle Web Center Content...
 
PEPFAR’s DATIM4U and Associated Interoperability Components
PEPFAR’s DATIM4U and Associated Interoperability ComponentsPEPFAR’s DATIM4U and Associated Interoperability Components
PEPFAR’s DATIM4U and Associated Interoperability Components
 
Health Information System: Interoperability and Integration to Maximize Effec...
Health Information System: Interoperability and Integration to Maximize Effec...Health Information System: Interoperability and Integration to Maximize Effec...
Health Information System: Interoperability and Integration to Maximize Effec...
 
IEEE Presentation
IEEE PresentationIEEE Presentation
IEEE Presentation
 
OpenStand – Principles for Open Standards and Open Development
OpenStand – Principles for Open Standards and Open DevelopmentOpenStand – Principles for Open Standards and Open Development
OpenStand – Principles for Open Standards and Open Development
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creations
 
Database Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant ArchitectureDatabase Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant Architecture
 
OOW09 Integration Architecture EBS R12
OOW09 Integration Architecture  EBS R12OOW09 Integration Architecture  EBS R12
OOW09 Integration Architecture EBS R12
 
Fusion Middleware Oracle Data Integrator
Fusion Middleware Oracle Data IntegratorFusion Middleware Oracle Data Integrator
Fusion Middleware Oracle Data Integrator
 
Trouble shoot with linux syslog
Trouble shoot with linux syslogTrouble shoot with linux syslog
Trouble shoot with linux syslog
 
Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanship
 

Similar to Mastering unix

Similar to Mastering unix (20)

Unix shell scripting tutorial
Unix shell scripting tutorialUnix shell scripting tutorial
Unix shell scripting tutorial
 
OverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxOverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docx
 
101 3.1 gnu and unix commands
101 3.1 gnu and unix commands101 3.1 gnu and unix commands
101 3.1 gnu and unix commands
 
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
 
Operating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptOperating System Laboratory presentation .ppt
Operating System Laboratory presentation .ppt
 
Unixscripting
UnixscriptingUnixscripting
Unixscripting
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Linux
LinuxLinux
Linux
 
Shell Scripting crash course.pdf
Shell Scripting crash course.pdfShell Scripting crash course.pdf
Shell Scripting crash course.pdf
 
Slides
SlidesSlides
Slides
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
60761 linux
60761 linux60761 linux
60761 linux
 
34-shell-programming.ppt
34-shell-programming.ppt34-shell-programming.ppt
34-shell-programming.ppt
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Shell Scripting and Programming.pptx
Shell Scripting and Programming.pptxShell Scripting and Programming.pptx
Shell Scripting and Programming.pptx
 
Shell Scripting and Programming.pptx
Shell Scripting and Programming.pptxShell Scripting and Programming.pptx
Shell Scripting and Programming.pptx
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
Unix
UnixUnix
Unix
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell Script
 
Licão 05 scripts exemple
Licão 05 scripts exempleLicão 05 scripts exemple
Licão 05 scripts exemple
 

More from Raghu nath

Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
Selection sort
Selection sortSelection sort
Selection sortRaghu nath
 
Binary search
Binary search Binary search
Binary search Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithmsRaghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp roleRaghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell ScriptingRaghu nath
 

More from Raghu nath (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
 
Msword
MswordMsword
Msword
 
Ms word
Ms wordMs word
Ms word
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Selection sort
Selection sortSelection sort
Selection sort
 
Binary search
Binary search Binary search
Binary search
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
 
Perl
PerlPerl
Perl
 

Recently uploaded

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 

Mastering unix

  • 2. Unix Special Characters  ( ; # $ ? & * ( ) [ ] ` ‘ “ +
  • 3. Shells  A shell is an environment in which we can run our commands, programs, and shell scripts.  Korn Shell /bin/ksh OR /usr/bin/ksh
  • 4.  A shell script can be executed in the following ways:  ksh shell_script_name  will create a Korn shell and execute the shell_script_name in the newly created Korn shell environment. shell_script_name.
  • 5. Different Types of Shells to Declare #!/usr/bin/sh OR #!/bin/sh Declares a Bourne shell #!/usr/bin/ksh OR #!/bin/ksh Declares a Korn shell #!/usr/bin/csh OR #!/bin/csh Declares a C shell #!/usr/bin/bash OR #!/bin/bash Declares a Bourne-Again shell
  • 6. Control Structures  The following control structures will be used extensively.  if ... then Statement  if [ test_command ]  then  commands  fi
  • 7.  if ... then ... else Statement  if [ test_command ]  then  commands  else  commands  fi
  • 8.  if ... then ... elif ... (else) Statement  if [ test_command ]  then  commands  elif [ test_command ]  then  commands  elif [ test_command ]  Then  commands  .  .  .  else (Optional)  commands  fi
  • 9.  for ... in Statement  for loop_variable in argument_list  do  commands  done
  • 10.  while Statement  while test_command_is_true  do  commands  done
  • 11.  until Statement  until test_command_is_true  Do  commands  done
  • 12.  case Statement  case $variable in  match_1)  commands_to_execute_for_1  ;;  match_2)  commands_to_execute_for_2  ;;
  • 13.  match_3)  commands_to_execute_for_3  ;;  .  .  .  *) (Optional - any other value)  commands_to_execute_for_no_match  ;;  esac
  • 14.  The last part of the case statement:  *)  commands_to_execute_for_no_match  ;;  is optional.
  • 15. Using break, continue, exit, and return  It is sometimes necessary to break out of a for or while loop, continue in the next block of code, exit completely out of the script, or return a function’s result back to the script that called the function.break is used to terminate the execution of the entire loop, after completing the execution of all of the lines of code up to the break statement. It then steps down to the code following the end of the loop.continue is used to transfer control to the next set of code, but it continues execution of the loop.exit will do just what one would expect: It exits the entire script. An integer may be added to an exit command (for example, exit 0), which will be sent as the return code.return is used in a function to send data back, or return a result, to the calling script.
  • 16. Unix Commands Review COMMAND DESCRIPTION passwd Change user password pwd Print current directory cd Change directory ls List of files in a directory wildcards * matches any number of characters, ? matches a single character file Print the type of file cat Display the contents of a file pr Display the contents of a file pg or page Display the contents of a file one page at a time
  • 17. Unix Commands Review (Cond…) more Display the contents of a file one page at a time clear Clear the screen cp or copy Copy a file chown Change the owner of a file chgrp Change the group of a file chmod Change file modes, permissions rm Remove a file from the system mv Rename a file mkdir Create a directory rmdir Remove a directory
  • 18. Unix Commands Review (Cond…) grep Pattern matching egrep grep command for extended regular expressions find Used to locate files and directories >> Append to the end of a file > Redirect, create, or overwrite a file | Pipe, used to string commands together || Logical OR—command1 || command2— execute command2 if command1 fails & Execute in background && Logical AND—command1 && command2— execute command2 if command1 succeeds