Exercise 1.1 – Basic commands of RHEL

  1. pwd : Use the pwd command to find out the path of the current working directory.
  2. cd : To navigate through the Linux files and directories.
  3. ls :  It is used to view the contents of a directory.
  4. cat : It is used to list the contents of a file on the standard output.  
  5. cp :   It is used to copy files from the current directory to a different directory.
  6. mv : The primary use of the mv command is to move files, although it can also be used to rename files.
  7. mkdir : It is used to make a new directory.
  8. rmdir : If you need to delete a directory, use the rmdir command.
  9. rm :  It is used to delete directories and the contents within them.
  10. touch :  It  allows you to create a blank new file (If already created then it will change the timestamp) through the Linux command line.
  11. find It is used for searches for files and directories.
  12. grep :  It is used for search through all the text in a given file.
  13. sudo :  This command enables you to perform tasks that require administrative or root permissions. 
  14. df :  It is used to get a report on the system’s disk space usage, shown in percentage and KBs.
  15. du :  It is used to check how much space a file or a directory takes.
  16. chmod : It is used to change the read, write, and execute permissions of files and directories.
  17. chown :  It enables you to change or transfer the ownership of a file to the specified username.
  18. pingIt is used to check your connectivity status to a server.
  19. man : you can easily learn how to use them right from Linux’s shell by using the man command.
  20. hostname : If you want to know the name of your host/network simply type hostname.
  21. useradd : It is used to create a new user.
  22. passwd :  It is used to adding a password to that user’s account.
  23. history  : If you want to review the commands you’ve entered before type history.
  24. echo : This command is used to move some data into a file.

Task by Trainer:-

  • Copy the file /etc/passwd to /var/tmp/passwd.
  • The file /var/tmp/passwd should be owned by the root user.
  • The file content in the /var/tmp/passwd should not be executable by anyone.
  • All other users have the ability to read content in /var/tmp/passwd.