Linux - Terminal, Shell, PWD, Flags, ls, man commands

Linux - Terminal, Shell, PWD, Flags, ls, man commands

Terminal -

A Tool which opens a window(CLI) for you, it takes input from you(User), as commands, and displays output on the screen.

You interact with the shell using terminal. So what is a Shell? and why there’s a need to talk to shell?

Shell -

It is a Command line Interface that will interpret our commands. It executes each and every command line by line.

Since everything in Linux is a File(even the commands) how will the Operating System know where is the file for a command and How to convert these instructions?

Answer is Shell will do all these things for you.

What happens when you start your Computer? -

Software in BIOS(Basic Input Output System) is executed. BIOS / Firmware is stored in a small chip in Motherboard.

  1. It will check if System is working correctly or not, It will Start the OS if everything is fine. This loads the Bootloader.

  2. Bootloader initializes OS.

pwd

Print working directory(pwd) prints the working directory starting from the root.

Its stored inside a environment variable($PWD).

ls

It gives us a list of contents (Files, Directories) of the current directory.

ls directory name will give you list of contents(Files, Directories) of that particular directory.

ls.png

Flags

They are arguments given with the commands. They modify the operation of the command.

In the above image -l and -a are flags, in which, -l will give us 10 fields specifying different things like whether its a File / Directory / Link, Permissions, Number of links / directories inside it, Owner’s username, Group to which it belongs, Size in Bytes, Last modified Date, its Name.

Note :- Field no. 2,3,4 will be having the Permissions.

-a is used to view Hidden files as well, they start from a Dot(.)

cd -

Used to change directory. cd directory Name will take you inside that directory. cd .. will bring you out of the current directory.

cd.png

mkdir -

mkdir.png

Used to create a directory.

-p is used when we’ve to create a directory inside a directory.

rm, rmdir -

rm.png

rm is used to delete a file, rmdir is used to delete a directory.

Whatis

It gives us a description of the command.

man

It gives us a manual of the specified command. This manual will have different flags which we can use with the command.

Its like a documentation.

Thank you so much for the patience shown, wish you all the best, Trust the Process.