SlideShare a Scribd company logo
1 of 25
Download to read offline
Dr. D. P.
Mishra
Digitally signed by Dr. D. P.
Mishra
DN: cn=Dr. D. P. Mishra,
o=durg, ou=BIT,
email=dpmishra@bitdurg.ac.
in, c=IN
Date: 2023.04.10 07:32:08
+05'30'
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
What is a Linux Shell and Why is it Important?
• A shell is a command-line interpreter program that parses and sends
commands to the operating system.
• This program represents an operating system's interactive interface
and the kernel's outermost layer (or shell).
• It allows users and programs to send signals and expose an operating
system's low-level utilities.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
1. Bourne Shell (sh)
• The Bourne shell was the first default shell on Unix systems, released
in 1979.
• The shell program name is sh, and the traditional location is /bin/sh.
• The Bourne shell quickly became popular because it
is compact and fast.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
2. C Shell (csh)
• The C shell (csh) is a Linux shell from the late 1970s whose main
objective was to improve interactive use and mimic the C language.
• Since the Linux kernel is predominantly written in C, the shell aims to
provide stylistic consistency across the system.
Features:
• History of the previous command.
• User-defined aliases for programs.
• Relative home directory (~).
• Built-in expression grammar.
Drawbacks of the C shell are:
• Syntax inconsistencies.
• No support for standard input/output (stdio) file handles or functions.
• Not fully recursive, which limits complex command handling.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
3. TENEX C Shell (tcsh)
• The TENEX C shell (tcsh) is an extension of the C shell (csh) merged in
the early 1980s.
• The shell is backward compatible with csh, with additional features
and concepts borrowed from the TENEX OS.
Features of the shell include:
• Advanced command history.
• Programmable autocomplete.
• Wildcard matching.
• Job control.
• Built-in where command.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
4. KornShell (ksh)
• The KornShell (ksh) is a Unix shell and language based on the Bourne
shell (sh) developed in the early 1980s.
• The location is in /bin/ksh or /bin/ksh93,
• while the prompt is the same as the Bourne shell ($ for a user and #
for root).
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
5. Debian Almquist Shell (dash)
• The Debian Almquist Shell (dash) is a Unix shell developed in the late
1990s from the Almquist shell (ash), which was ported to Debian and
renamed.
• Dash is famous for being the default shell for Ubuntu and Debian.
• The shell is minimal and POSIX compliant, making it convenient for OS
startup scripts.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
6. Bourne Again Shell (bash)
• The Bourne Again shell is a Unix shell and command language created
as an extension of the Bourne shell (sh) in 1989.
• The shell program is the default login shell for many Linux distributions
and earlier versions of macOS.
• The shell name shortens to bash, and the location is /bin/bash.
• Like the Bourne shell, the bash prompt is $ for a regular user and # for
root.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
7. Z Shell (zsh)
• The Z shell (zsh) is a Unix shell created as an extension for the Bourne
shell in the early 1990s.
• The feature-rich shell borrows ideas from ksh and tcsh to create a well-
built and usable alternative.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
8. Friendly Interactive Shell (fish)
• The Friendly Interactive Shell (fish) is a Unix shell released in the mid-
2000s with a focus on usability.
• The feature-rich shell does not require additional configuration, which
makes it user-friendly from the start.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Viva Questions
1.what is an file system?
2.why we are using sed command?
3.which command is used to create file?
4.why we are using chmod?
5.which permissions are provided to files?
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Viva Questions
1. what is an directory?
2. which command is used to create directory?
3. what is the purpose of wc cmd?
4. which command is used to change the directory
5. why we are using grep command?
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Viva Questions
1. what is an shell script?
2. why we are using egrep command?
3. what is the purpose of fgrep?
4. write a syntax of grep?
5. what is an shell variable?
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Viva Questions
1.which command is used to display a file?
2.why we are using fd?
3.why we are using popen function?
4.why we are using mv command?
5.how we can assign permissions to the files?
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
#!/bin/bash
read -p "Enter a string: " str
# reverse the string
reverse=$(echo $str | rev)
if [ "$str" == "$reverse" ]; then
echo "The string is a palindrome."
else
echo "The string is not a
palindrome."
fi
• The rev command is used to
reverse the string.
• The if statement checks if the
original string is equal to the
reversed string.
• If they are equal, it means the
string is a palindrome and the
script prints a message
accordingly.
• e.g. RACECAR , LEVEL
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
9.1 Shell script to check palindrome or not
#!/bin/bash
read -p "Enter the first string: " str1
read -p "Enter the second string: " str2
if [ "$str1" == "$str2" ];
then
echo "The strings are equal."
else
echo "The strings are not equal."
fi
• The if statement checks if the two
strings are equal.
• If they are equal, it means that
the strings are the same and the
script prints a message saying that
they are equal.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
9.2 Shell Script to compare two Strings
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Error: No file name specified."
exit 1
fi
filename=$1
if [ -r $filename ] && [ -w $filename ]; then
echo "The file $filename has both read and write permission."
elif [ -r $filename ]; then
echo "The file $filename has read permission but not write permission."
elif [ -w $filename ]; then
echo "The file $filename has write permission but not read permission."
else
echo "The file $filename does not have read or write permission."
fi
• The if statement checks if the file
has both read and write
permission using the -r and -w
options respectively.
• If it has both permissions, the
script prints a message saying that
the file has both read and write
permission.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
9.3 Write a script to read file name from command line
and check if it read and write permission or not
#!/bin/bash
count=0
for file in *
do
if [ -f $file ]; then
((count++))
fi
done
echo "The number of files in the current directory
is: $count"
• The if statement checks if the
current file is a regular file using
the -f option.
• If it is, the script increments the
count variable.
• After the loop completes, the
script prints the number of files in
the current directory.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
9.4 Write a shell script to count number of only files
present in current directory.
#!/bin/bash
read -p "Enter a string: " str
reverse=""
for (( i=${#str}-1; i>=0; i-- ))
do
reverse="$reverse${str:$i:1}"
done
echo "The reversed string is: $reverse"
• The script initializes an empty string
called reverse.
• The for loop iterates through each
character in the string str in reverse
order.
• It uses parameter expansion to
extract the character at each index
and appends it to the reverse string.
• After the loop completes, the script
prints the reversed string.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
9.5 Write a script to reverse a given string.
Task / Assignment
1. Write a script to copy list of file into specified directory.
2. Write a shell script to list all of the directory files in a directory.
3. Write a shell script to count number of words present in a file
without using commands.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Types of Linux Shells

More Related Content

Similar to Types of Linux Shells

Shell-Scripting-1.pdf
Shell-Scripting-1.pdfShell-Scripting-1.pdf
Shell-Scripting-1.pdfaznabi
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linuxrowiebornia
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptxDavidMaina47
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiicmdept1
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linuxkishore1986
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSvtunotesbysree
 
390aLecture05_12sp.ppt
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.pptmugeshmsd5
 
basic shell scripting syntex
basic shell scripting syntexbasic shell scripting syntex
basic shell scripting syntexKsd Che
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scriptsPrashantTechment
 
Shell tutorial
Shell tutorialShell tutorial
Shell tutorialVu Duy Tu
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell ScriptAmit Ghosh
 

Similar to Types of Linux Shells (20)

Shell-Scripting-1.pdf
Shell-Scripting-1.pdfShell-Scripting-1.pdf
Shell-Scripting-1.pdf
 
Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02
 
Licão 05 scripts exemple
Licão 05 scripts exempleLicão 05 scripts exemple
Licão 05 scripts exemple
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkii
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
 
60761 linux
60761 linux60761 linux
60761 linux
 
390aLecture05_12sp.ppt
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.ppt
 
Linux
LinuxLinux
Linux
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Unix lab
Unix labUnix lab
Unix lab
 
basic shell scripting syntex
basic shell scripting syntexbasic shell scripting syntex
basic shell scripting syntex
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Shell tutorial
Shell tutorialShell tutorial
Shell tutorial
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell Script
 

More from BIT DURG

JavaScript
JavaScriptJavaScript
JavaScriptBIT DURG
 
Understanding WWW
Understanding WWWUnderstanding WWW
Understanding WWWBIT DURG
 
Computer Networks
Computer NetworksComputer Networks
Computer NetworksBIT DURG
 
Computer Basics
Computer Basics Computer Basics
Computer Basics BIT DURG
 
ISDN & ATM
ISDN & ATMISDN & ATM
ISDN & ATMBIT DURG
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control ProtocolBIT DURG
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing ProtocolsBIT DURG
 
Internet Protocol.pdf
Internet Protocol.pdfInternet Protocol.pdf
Internet Protocol.pdfBIT DURG
 
Intternetworking With TCP/IP
Intternetworking With TCP/IPIntternetworking With TCP/IP
Intternetworking With TCP/IPBIT DURG
 
Computer Network Basics
Computer Network BasicsComputer Network Basics
Computer Network BasicsBIT DURG
 
File Access Permission
File Access PermissionFile Access Permission
File Access PermissionBIT DURG
 
Control flow and related shell cripts
Control flow and related shell criptsControl flow and related shell cripts
Control flow and related shell criptsBIT DURG
 
Basic Shell Programs
Basic Shell ProgramsBasic Shell Programs
Basic Shell ProgramsBIT DURG
 
Filters & Vi Editor
Filters & Vi EditorFilters & Vi Editor
Filters & Vi EditorBIT DURG
 
Linux Installation
Linux InstallationLinux Installation
Linux InstallationBIT DURG
 
Basics of GNU & Linux
Basics of GNU & LinuxBasics of GNU & Linux
Basics of GNU & LinuxBIT DURG
 
National youth day
National youth dayNational youth day
National youth dayBIT DURG
 
Visual Basic Tutorials
Visual Basic TutorialsVisual Basic Tutorials
Visual Basic TutorialsBIT DURG
 

More from BIT DURG (20)

HTML_DOM
HTML_DOMHTML_DOM
HTML_DOM
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Understanding WWW
Understanding WWWUnderstanding WWW
Understanding WWW
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
Computer Basics
Computer Basics Computer Basics
Computer Basics
 
ISDN & ATM
ISDN & ATMISDN & ATM
ISDN & ATM
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control Protocol
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
 
Internet Protocol.pdf
Internet Protocol.pdfInternet Protocol.pdf
Internet Protocol.pdf
 
Intternetworking With TCP/IP
Intternetworking With TCP/IPIntternetworking With TCP/IP
Intternetworking With TCP/IP
 
Computer Network Basics
Computer Network BasicsComputer Network Basics
Computer Network Basics
 
MySQL
MySQL MySQL
MySQL
 
File Access Permission
File Access PermissionFile Access Permission
File Access Permission
 
Control flow and related shell cripts
Control flow and related shell criptsControl flow and related shell cripts
Control flow and related shell cripts
 
Basic Shell Programs
Basic Shell ProgramsBasic Shell Programs
Basic Shell Programs
 
Filters & Vi Editor
Filters & Vi EditorFilters & Vi Editor
Filters & Vi Editor
 
Linux Installation
Linux InstallationLinux Installation
Linux Installation
 
Basics of GNU & Linux
Basics of GNU & LinuxBasics of GNU & Linux
Basics of GNU & Linux
 
National youth day
National youth dayNational youth day
National youth day
 
Visual Basic Tutorials
Visual Basic TutorialsVisual Basic Tutorials
Visual Basic Tutorials
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 

Types of Linux Shells

  • 1. Dr. D. P. Mishra Digitally signed by Dr. D. P. Mishra DN: cn=Dr. D. P. Mishra, o=durg, ou=BIT, email=dpmishra@bitdurg.ac. in, c=IN Date: 2023.04.10 07:32:08 +05'30'
  • 6. What is a Linux Shell and Why is it Important? • A shell is a command-line interpreter program that parses and sends commands to the operating system. • This program represents an operating system's interactive interface and the kernel's outermost layer (or shell). • It allows users and programs to send signals and expose an operating system's low-level utilities. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 7. 1. Bourne Shell (sh) • The Bourne shell was the first default shell on Unix systems, released in 1979. • The shell program name is sh, and the traditional location is /bin/sh. • The Bourne shell quickly became popular because it is compact and fast. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 8. 2. C Shell (csh) • The C shell (csh) is a Linux shell from the late 1970s whose main objective was to improve interactive use and mimic the C language. • Since the Linux kernel is predominantly written in C, the shell aims to provide stylistic consistency across the system. Features: • History of the previous command. • User-defined aliases for programs. • Relative home directory (~). • Built-in expression grammar. Drawbacks of the C shell are: • Syntax inconsistencies. • No support for standard input/output (stdio) file handles or functions. • Not fully recursive, which limits complex command handling. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 9. 3. TENEX C Shell (tcsh) • The TENEX C shell (tcsh) is an extension of the C shell (csh) merged in the early 1980s. • The shell is backward compatible with csh, with additional features and concepts borrowed from the TENEX OS. Features of the shell include: • Advanced command history. • Programmable autocomplete. • Wildcard matching. • Job control. • Built-in where command. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 10. 4. KornShell (ksh) • The KornShell (ksh) is a Unix shell and language based on the Bourne shell (sh) developed in the early 1980s. • The location is in /bin/ksh or /bin/ksh93, • while the prompt is the same as the Bourne shell ($ for a user and # for root). Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 11. 5. Debian Almquist Shell (dash) • The Debian Almquist Shell (dash) is a Unix shell developed in the late 1990s from the Almquist shell (ash), which was ported to Debian and renamed. • Dash is famous for being the default shell for Ubuntu and Debian. • The shell is minimal and POSIX compliant, making it convenient for OS startup scripts. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 12. 6. Bourne Again Shell (bash) • The Bourne Again shell is a Unix shell and command language created as an extension of the Bourne shell (sh) in 1989. • The shell program is the default login shell for many Linux distributions and earlier versions of macOS. • The shell name shortens to bash, and the location is /bin/bash. • Like the Bourne shell, the bash prompt is $ for a regular user and # for root. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 13. 7. Z Shell (zsh) • The Z shell (zsh) is a Unix shell created as an extension for the Bourne shell in the early 1990s. • The feature-rich shell borrows ideas from ksh and tcsh to create a well- built and usable alternative. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 14. 8. Friendly Interactive Shell (fish) • The Friendly Interactive Shell (fish) is a Unix shell released in the mid- 2000s with a focus on usability. • The feature-rich shell does not require additional configuration, which makes it user-friendly from the start. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 15. Viva Questions 1.what is an file system? 2.why we are using sed command? 3.which command is used to create file? 4.why we are using chmod? 5.which permissions are provided to files? Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 16. Viva Questions 1. what is an directory? 2. which command is used to create directory? 3. what is the purpose of wc cmd? 4. which command is used to change the directory 5. why we are using grep command? Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 17. Viva Questions 1. what is an shell script? 2. why we are using egrep command? 3. what is the purpose of fgrep? 4. write a syntax of grep? 5. what is an shell variable? Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 18. Viva Questions 1.which command is used to display a file? 2.why we are using fd? 3.why we are using popen function? 4.why we are using mv command? 5.how we can assign permissions to the files? Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 19. #!/bin/bash read -p "Enter a string: " str # reverse the string reverse=$(echo $str | rev) if [ "$str" == "$reverse" ]; then echo "The string is a palindrome." else echo "The string is not a palindrome." fi • The rev command is used to reverse the string. • The if statement checks if the original string is equal to the reversed string. • If they are equal, it means the string is a palindrome and the script prints a message accordingly. • e.g. RACECAR , LEVEL Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg 9.1 Shell script to check palindrome or not
  • 20. #!/bin/bash read -p "Enter the first string: " str1 read -p "Enter the second string: " str2 if [ "$str1" == "$str2" ]; then echo "The strings are equal." else echo "The strings are not equal." fi • The if statement checks if the two strings are equal. • If they are equal, it means that the strings are the same and the script prints a message saying that they are equal. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg 9.2 Shell Script to compare two Strings
  • 21. #!/bin/bash if [ $# -eq 0 ]; then echo "Error: No file name specified." exit 1 fi filename=$1 if [ -r $filename ] && [ -w $filename ]; then echo "The file $filename has both read and write permission." elif [ -r $filename ]; then echo "The file $filename has read permission but not write permission." elif [ -w $filename ]; then echo "The file $filename has write permission but not read permission." else echo "The file $filename does not have read or write permission." fi • The if statement checks if the file has both read and write permission using the -r and -w options respectively. • If it has both permissions, the script prints a message saying that the file has both read and write permission. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg 9.3 Write a script to read file name from command line and check if it read and write permission or not
  • 22. #!/bin/bash count=0 for file in * do if [ -f $file ]; then ((count++)) fi done echo "The number of files in the current directory is: $count" • The if statement checks if the current file is a regular file using the -f option. • If it is, the script increments the count variable. • After the loop completes, the script prints the number of files in the current directory. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg 9.4 Write a shell script to count number of only files present in current directory.
  • 23. #!/bin/bash read -p "Enter a string: " str reverse="" for (( i=${#str}-1; i>=0; i-- )) do reverse="$reverse${str:$i:1}" done echo "The reversed string is: $reverse" • The script initializes an empty string called reverse. • The for loop iterates through each character in the string str in reverse order. • It uses parameter expansion to extract the character at each index and appends it to the reverse string. • After the loop completes, the script prints the reversed string. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg 9.5 Write a script to reverse a given string.
  • 24. Task / Assignment 1. Write a script to copy list of file into specified directory. 2. Write a shell script to list all of the directory files in a directory. 3. Write a shell script to count number of words present in a file without using commands. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg