Day 2 : Basic Linux Commands

Day 2 : Basic Linux Commands

  • BASIC MAIN COMMANDS

  • whoami -> prints the username currently logged into the terminal session.

  • eg. whoami

  • rohit

whoami

  • man -> we type man to get manual.

  • eg. "man ls" we get all the command related to listing.

  • man ls command

man

  • Description of manual command.

man  ls

  • clear -> It is used to clear the terminal or screen.

  • clear -x -> It clear the terminal but we can scroll to check the previous data.

  • pwd -> Whenever we feel lost in the file system, call the pwd command to know where you are : It will print current folder path.

  • pwd

  • /user/rohit/Document/

pwd

listing command

  • ls -> Inside a folder you can list all the files that the folder contain using ls command.

ls

  • ls -l -> provides a long form of list.

ls -l

  • ls -a -> also show .files from the list.

ls -a

  • ls -al -> show both long form and .files from the list.

ls -al

  • ls -i -> print the index number of each file.

ls -i

Change Directory

  • cd -> cd means "change directory" which changes path from one folder to another folder.

  • eg. " cd Documents/ " so now we are in Documents folder.

cd

  • cd .. -> This means change directory to one folder back.

cd go back one folder

  • cd ../../.. -> This means change directory to 3 folder back. (Note:It can do upto 3 folders only)

cd go back 3 folder

Make Directory

  • mkdir -> Means Make Directory or Make One Folder.

  • eg.mkdir fruits -> so we made fruit folder.

mkdir

  • mkdir -p -> is used to create nested folder.

  • eg. mkdir -p A/B/C/D/E so we created nested folder of A where we folder insider folder.


Happy Learning :)

Did you find this article valuable?

Support DevOps by becoming a sponsor. Any amount is appreciated!