[No audio]
Shell. What is the shell?
In this lesson, we'll cover about the shell, how the shell
work, and how you can run command within the shell, or
how the environment is set up in a shell.
So what exactly is a shell?
Shell is like a container.
Like you have like a tupperware in your
home or any kind of container that holds
your environment your information inside of it.
It interfaces between users and
Kernels or operating systems.
So you have built an operating system,
and then it has provided a platform for
you to execute commands. Again, Windows is one
of the platform, and in Windows operating system,
when you start up a GUI, you execute commands
by running, by double clicking on a program.
So that GUI interface is your shell. In Linux, when
you don't have a GUI, you are given a terminal
shell or CLI command that is your shell.
To find your shell you could run a command like echo dollar
and zero, that will tell you what shell you are in.
And you could also get a listing of
all your shells in your Linux distribution by
running the command cat /etc/shells.
Your shell is also inside of /etc/passwd
that is defined inside of the file.
In Windows, GUI is a shell, in Linux, KDE
GUI is a shell, in Linux sh which is shell, bash, etc.
All these are the shell that is provided to a user.
Again, we're looking at this diagram, again,
and we are second from the top.
You'll see the application that talks to the shell
and then shell talks to Kernel, and Kernel is
the one that is telling hardware what to do.
Let's look at our Linux machine and we'll
see how we could find our shell.
Open up a terminal real quick.
[No audio]
And when you do cat, sorry when you do echo
dollar zero, it tells you you are in bash.
So you could look at the available shells that is
installed in your distribution by doing cat /etc/shells and
it tells you all the shells that are available.
And when you look at /etc/passwd, cat /etc/passwd
and you'll see in my username, which is right here,
it tells the shell all the way at the end
that I have a defined shell which is /bin/bash.
I could change that shell if I want
to, to a different shelf, but I try
to keep it consistent with other users.
So that's what the shell does and we'll cover
the later, in the later lessons, how we could talk to shell to
create scripts and other things to automate our tasks.
[No audio]