Different Shells In Linux | Bash vs C Shell vs Korn Shell | Linux Certification Training | Edureka
- December 30, 2023
- Posted by: MainInstructor
- Category: BASIC C Go Java Regular Expressions
Video Title: Different Shells In Linux | Bash vs C Shell vs Korn Shell | Linux Certification Training | Edureka
Shell’s Alec brands everybody has a favorite and vehemently defends their choice and occasionally they might tell you why you should switch true that shells can offer different capabilities but they all implement core ideas that were developed decades ago hi all this is a partner from Ed Eureka and in this module we are
Going to talk about the different Linux shells how they are similar and different from each other so before I begin let me take you through the topics that I’m going to cover today first of all I’m going to talk a little bit about the kernel and
The shell why there might be a confusion between both of them for most people then I’m gonna spend some time talking about the evolution of the Linux shells warious different shells then we’re gonna talk about a very common confusion shell versus bash are they the same thing are they different how different
Are they then come the meat and potatoes of this video so shell was his bash versus other Linux shells and finally we’ll spend some time talking about which shell is most apt for you obviously in the end it is your choice I’m only here to help so without much
Ado let’s get straight into the module so first of all the kernel in the shell so let’s talk a little bit about the kernel and the shell so what is a kernel now the computer programs that allocate the system resources and coordinate all the details of the computer’s internals
Is basically known as the kernel now the kernel is the heart of any operating system it interacts with the hardware and most of the tasks like memory management – dueling and file management now users communicate with a kernel through a program called the shell the shell is that utility that processes your
Requests when you type in a command basically at your terminal the shell interprets the command and calls the program that you want the shell uses standard syntax for all commands it is basically a command-line interpreter which translates commands entered by the user and converts them into a language that is understood by
The kernel and obviously the next logical question is what is a shell script since I spoke about the shell it is only obvious that I’m going to mention the shell script the basic concept of a shell script is a list of commands which are listed in order of
Execution with that let’s move on to our next topic which is evolution of the shell so let’s begin with a short history of the modern shells and then explore some of the useful and exotic shells that are available in Linux today all right so the shell or the command
Line interpreter have a long history but this discussion begins with the first ever UNIX shell Ken Thompson of Bell Labs discovered the first shell for the UNIX called the v6 in 1971 now similar to its predecessor this shell was an independent user program that could be executed outside the kernel now I’m not
Going to talk about the Samson shell we are going to begin our journey with a look at the modern shell since 1977 when the Bourne shell was introduced now the Bourne shell created by Steven born at the AT&T Bell Labs remains useful even today the author developed the bourne
Shell after working on an Algol 68 compiler so you’ll find its grammar more similar to the algorithmic language than other shells now the source code itself although developed and C even made use of macros to give it the Algol 68 flavor now the Bourne shell have two primary
Goals to serve as a command-line interpreter to interactively execute commands for the operating system and for scripting in addition to replacing the thompson shell the bourne shell offered several advantages over its predecessors now the bone introduced control flows loops and variables into scripts providing a more functional language to interact with the operating
System now the shell also permitted you to use shell scripts as filters providing integrated support for handling signals but lacked the ability to define functions finally it incorporated a number of features that we used today including command substitution and shear documents to embed preserved string literals
Within a script now the bone shell was not only an important step forward but also an anchor for numerous derivatives many of which are used today in typical Linux systems next we have the C shell which came in 1978 it was created by Bill joy while he was still a graduate
Student it has been widely distributed beginning with the two BSD release of Berkeley software distribution the C shell is a command processor typically run in a text window allowing the user to type commands now the C shell can also read commands from a file called a script like all the Nok shells it
Supports file name while carding piping here documents command substitution variables and control structures for condition testing what differentiated the C shell from others especially in the 1980s for its interactive features and overall style its new features made it easier and faster to use the overall style of the language looked more like C
Programming language and was seen as more readable now another improvement that we saw on the bourne shell was the conch shell in 1983 it was developed by David Cohen of Bell Labs again as a comprehensive combined version of other major shells that were present at that time the
Initial development was based on the bone shell source code now the conch shell is backward compatible with the bourne shell and includes many features of the C shell as well now the conch shell compiles with POSIX to shell and utilities major differences between the corn shell and the traditional bourne shell include job
Control command aliasing and command history that is designed after the corresponding C shell features after the conch shell we have the 10x C shell which was a derivative of your basic C shell now this shell in 1983 was essentially the seashell but with programmable command-line completion come online editing and a few
Other features then we have bash which still remains one of the most popular shelf even in today’s time now this was written by Brian Fox for the GNU project as a free software replacement for the bond shell it had been distributed widely as default log and shell for most
Linux distributions and Apple’s Mac OS now the bash can also read and execute commands from a file like all Linux and UNIX shells it supports filename blobbing piping here documents and command substitution the keyword syntax and other basic features of the language are all from the basic shell the shells name is an
Acronym for bourne-again shell upon on the name of the bourne shell that it replaces the bash commands syntax is a superset of the bourne shell command syntax it supports brace expansion command line completion basic debugging and exception handling using trap now it can execute the vast majority of shell scripts
Without modification with the exception of the bourne shell scripts tumbling into french syntax behavior the bash command syntax includes ideas drawn from the conch shell and the sea shell as well after that the world came across various other shells such as the public domain conch shell which was basically a
Public domain or a free version of the conch shell you had the alchemist shell then you had the extensible shell or the plan nine shell today we have many other shells namely your z shell your debian arm quest shell or the – shell and the mere bsd conch shell in this segment i
Am going to majorly focus on four shells which will give you an idea of all the other derivative shells as well i’m going to be talking about first the basic shell the bourne shell i’m going to talk about the bourne-again shell the conch shell the 10x sea shell and an
Exotic shell called the scheme moving on let’s talk a little bit about shell versus bash now most people use these two terms synonymously but they are not the same thing now the shell come on language is a programming language which is described by the POSIX standard it has many
Implementations including the bash now because shell is a specification and not an implementation the /bin slash sh is a symlink or a hard link to an actual implementation on most of the POSIX systems now the bash started as a shell compatible implementation but as time passed it has acquired many extensions
Now many of these extensions may change the behavior of valid POSIX shell scripts so by itself bash is not a POSIX shell rather it is a dialect of the POSIX shell so summarizing about this I would say that shell is actually a specification of which bash is an
Implementation for a long time the shebang line of the shell script used to point to the bash on most Linux systems as a result it has become more safe to ignore the difference between the two but both of them are pretty much different things with that let’s look at
Shell versus bash versus a few other Linux shells burst of all the C shell now if you are a network or systems administrator in a Linux or UNIX environment you will most certainly run into the C shell so it is good to at least have some familiarity with it now
Casual users and even most developers will probably suggest other shells but if you are comfortable with C programming language then the C shell is a great shell to begin with now the con shell is the one that you can use interactively to execute commands from the command line or programmatically to
Create scripts that can automate many computer maintenance and system administration tasks now bash is far too big a subject to be covered fully in a single line but it is one of the most commonly used scripting languages that you will find today people are comfortable with bash scripting and most
Of the content that you will find around shell scripting will be in bash but you should probably learn it for its versatility and ease of use more than anything most colleges and universities teach their students to script and bash because it’s a great place to begin as well so now
I’m going to run the same script in three different shells which are derivatives of the three most basic shells which are your Bourne shell your seashell and your conch shell to see how different or similar they are so for that I have opened up my terminal
This is Center West 7 the fedora version so what I’m going to try to do is take a single argument which is going to be a directory name and my script is supposed to search recursively for all executable files in that directory along with the number of files that are found I’m going
To reuse the script design in each of the examples to illustrate the differences so first let’s see what directories do we have ok so what I’m interested in is this Eclipse directory so what I’m gonna do is okay this is one file Java oxigen let’s see if it’s executable or not
Okay as we see the Java oxygen file is executable so when I pass Eclipse as an argument this directory as an argument to any of my scripts I am supposed to get an answer that this Java oxygen file is executable and the number of executable files found in that
Particular directory is equal to one suppose I am going to run the tenex shell and see so I’m going to go and open up this 10x shell so basically what I did is open up my 10x script it’s divided into three basic sections first note that I use the shebang
Symbol to declare this file as interpretable by the defined shell this allows me to execute the file as a regular executable rather than preceded with an interpreter binary all right it maintains a count of the executable files found so I initialize this count with 0 here so the first section this
Section right here tests the arguments passed by the user this argv variable represents the number of arguments that are passed excluding the command name itself now you can access these arguments by specifying their index for example if I say this hash 1 it refers to the first argument
The script is expecting one argument if it doesn’t find it it emits an error image so using this dollar 0 I am going to indicate the command name that was typed now let’s come to the second section this basically ensures that the argument passed in was a directory the d
Operator here the – d operator here returns true if the argument is a directory but note that I specify a naught directory sign here this exclamatory symbol which means negate now this way the expression says that if an argument is not a directory you emit an error message which is this one and
For the final section it I treats the files in the directory to test whether they are execute I use the convenient for each I traitor which loops through each entry in the parentheses in this case which is the directory and then tests each as a part
Of the loop now this step here uses the – X operator to test whether the file isn’t executable if it is the file is emitted and the count is increased I end the script by omitting the count of executables here ok so now that we have understood what the script is let’s go
Ahead and run this and then I’m going to try Eclipse and as we had predicted it says that Java oxygen is your executable file and one executable files found now let me clear this out for you next let’s try doing the same thing with our kornshell
Now this is the code now as you can see our shebang line immediately it’s different now this con shell is a derivative of the bourne shell and it looks so much more similar to it than the sea shell so let’s look at our example again now the first thing you’ll
Notice here is its similarity to the first code that I had put up let me open it side-by-side for you okay so what I’m gonna do is I am going to open another new terminal let me just open another tab right here another new window so I can basically show you the
Similarity between both of these so I’m gonna go ahead and okay now we have these two on both sides so the first thing you’ll notice on your conscience script is its similarity to the 10x shell script structurally the script is almost identical at the first second and third parts of the script you
Have your test arguments then you have your insure argument which is a directory and then you iterate the directory to emit the executable files but the key differences are evident in the way conditionals expressions and the I tration is performed for example instead of operating C like test
Operators the key H adopts the typical bond-style operators so here you can see this not equal to vs. here this not equal to now the con shell also has some differences related to the iteration now in the conch shell the for instructure is used with the command substitution to
Represent the list of files created from the standard output of the command LS representing the contents of the names of directory in addition to the other features defined here the corn supports the alias feature to replace a word with the user-defined string now the corn has many of the features that are disabled
By default such as filename completion but you can enable it if you want to so let me close this so let’s try running this file and let’s put an eclipse again and as you see the answer is the same okay finally you’re going to try the same
Thing using the bash or the born again shell now the batch has continued to evolve with new features support for regular expressions and associative Ares now although some of these features may not be present in other scripting languages it’s possible to write scripts that are compatible with other languages
To this point this script that you see here is identical to the corn shell script except for the shebang difference let me open the conch shell real quick and give you a side-by-side comparison on this okay so as you can see it’s pretty much the same except for your shebang line
Which obviously has to be different because of where they are pointing one key difference among these shells is the licenses under which they are released now the bash as you would expect having been developed by the GNU project is released under GPL but the c-shell 10x
Sea shell z shell and so on are released under BSD in bsd-like license the con shell is available under the common public license but apart from that as you can see the way you write the script in bash and call is the same except for their shebang line so let me just run
This and sure do and as you can see the answer is the same now my point being why I chose these three specific shells is that it will give you an idea of how all the other derivative shells work more or less it’s going to be similar to these
Three basic shells else your logic will always remain the same would that let me move back to my presentation now apart from these you can go ahead and pick the shell you like many of the ideas and much of the interfaces of the shells remain the same almost 35 years later a
Tremendous testament to the original authors of the early shells now in an industry that continuously reinvents itself the shell has been improved upon but not substantially changed although there have been attempts to create specialized shells customized shells the bourne shell derivatives continue to be the primary
Shells in use with that i would like to close the session thank you and have a great day ahead I hope you have enjoyed listening to this video please be kind enough to like it and you can comment any of your doubts and queries and we
Will reply them at the earliest do look out for more videos in our playlist and subscribe to Eddie rekha channel to learn more happy learning
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Edureka Linux Training and Certification Curriculum, Visit the website: http://bit.ly/2CzTN8u
Thanks a lot. Very helpful video. I was looking for this type of video which clearly explains the difference between these shells with examples.
Why do Network Admins use C Shell specifically?
Very important content. Learnt a lot! Thanks for making this free.
Thanks for the tutorial. Very well explained.
keep going.. as we r more interest to learn ….tnk u so much team. do more videos .
What is the difference between shell scripting and bash scripting.
So what happens when you execute a directory?
Great video
Nice video sir ,can u teach kaali linux