Common linux commands for daily use

  1. pwd-used to check the present working directory

  2. mkdir-used for creating directory

  3. ls- list all files of the current directory

  4. cd / - changes to root directory

-->Note: if we are using user who doesn’t have rights as root user then only in /home directory we are able to make the Folder.

  1. whoami- to know the current logged in user

    -->In /bin directory here all installed tools binary are present.

    -->/tmp- contains temporary files

    -->/var/log- here all log files are present

    -->/root- who has all permissions which is also called as root user

    -->~-represents the home directory

  2. clear- used for clearing the terminal

  3. touch hello.txt – creates a blank file called hello.txt

  4. echo “Hello World” – prints hello world

  5. cat hello.txt- used for viewing the contents of file

  6. echo all good \>hello.txt- stores the text in hello.txt

  7. mv hello.txt /test – moves the file to test directory

  8. history- shows all commands peformed on the terminal

  9. mkdir dev qa test –creates multiple directories

  10. mkdir –p /dev/qa/test – creates nested directory(directory inside directory)

  11. mkdir /student{1..10}- used for creating 10 student directory in series number

  12. uname- shows the name of the kernel

  13. cp- used for copying the files from source location to destination

  14. sudo rm -r student* -removes the directories whose name consist of student

  15. cp –r –copies the files recursively

  16. sudo useradd rathesh- creates a user

  17. sudo useradd -m rathesh1 – creates a user also creates directory of the same in /home

  18. ls –la –lists all files including the hidden one with the file permission

  19. head -n 3 stock_pack_operation_lot.py shows the first three lines of the file

  20. tail -3 stock_pack_operation_lot.py- shows bottom 3 lines of the file

  21. diff stock_pack_operation_lot.py stock_pack_operation_lot_old.py used for comparing two different files