About Shell
Shell
You are using a shell right now, and that shell is almost certainly called bash (it definitely is unless you changed something), the Bourne Again Shell (which is making fun of the Bourne shell which bash replaced.) It's by far the most common shell and is over 30 years old.
There are other shells and we'll talk more about them later, the most common of which are zsh, ash, PowerShell, and cmd.exe.
File System
The way bash works is that you are always in a folder somewhere on your computer. Think of it like your computer's File Explorer or Finder: you can navigate into and out of folders while you look for files.
- Our first command we're going to run in your computer is
pwd
. So typepwd
and hit enter. This will send the command pwd to the shell which will evaluate that and print out the answer. pwd
print the current working directory path.
Help
- you can add
--help
at the end of shell command and it'll usually spit out some brief instructions of how to use the program.
pwd --help
Navigating Around
- Navigating one directory(folder) to another in linux shell we used the
cd
command.
cd ..
..
is a relative path that means "up one directory." Because I wanted to go from/home/ubuntu
to/home
,- move to
/home/hassanali/
to the/home/hassanali/Downloads
directory.
cd Downloads
ls
command help to the show list of directory.
ls