DEV Community

Mohd Talha
Mohd Talha

Posted on • Updated on

The Shell

Hi everyone, i am sharing some useful information of the Bash Terminal with important beginner friendly commands.

What is the shell?
Character User Interface: The Shell, is available on nearly all platforms, nearly all are roughly the same: they allow you to run programs, give them input, and inspect their output in a semi-structured way.

Here we focus on Bash Shell
Some useful commands -

side:~$ date
Wed 09 Sep 2020 with the current time will be displayed
Enter fullscreen mode Exit fullscreen mode
side:~$ echo hello
hello
Enter fullscreen mode Exit fullscreen mode
side:~$ echo $PATH
$PATH  is an environment variable that lists which directories the shell should search for programs when it is given a command
Enter fullscreen mode Exit fullscreen mode
side:~$ which echo
Finds out which file is executed for a given program
Enter fullscreen mode Exit fullscreen mode
side:~$ pwd
Gives the present working directory
Enter fullscreen mode Exit fullscreen mode
side:~$ cd /home
Change directory to home
a path that starts with / is an absolute path.
Any other path is a relative path.
Enter fullscreen mode Exit fullscreen mode
side:~$ cd ..
Changes 🔙 to the previous directory
Enter fullscreen mode Exit fullscreen mode
side:~$ ls
Gives what is present inside the directory
Enter fullscreen mode Exit fullscreen mode
side:~$ ls -l
This one gives us more information about each file or directory present
Enter fullscreen mode Exit fullscreen mode

Most important to remember

side:~$ man ls
man command gives you the manual pages for a certain program in this case the ls command.
Enter fullscreen mode Exit fullscreen mode

What commands would you like to add here?

Top comments (2)

Collapse
 
fennecdjay profile image
Jérémie Astor

Did you consider putting your code in blocks?
as in

side:~$ date
Wed 09 Sep 2020 with the current time will be displayed
Collapse
 
taltrums profile image
Mohd Talha

Ohh sorry, thank you so much, i will do it now. 😊