Exercise 1.1 – Basic commands of RHEL
- pwd : Use the pwd command to find out the path of the current working directory.
- cd : To navigate through the Linux files and directories.
- ls : It is used to view the contents of a directory.
- cat : It is used to list the contents of a file on the standard output.
- cp : It is used to copy files from the current directory to a different directory.
- mv : The primary use of the mv command is to move files, although it can also be used to rename files.
- mkdir : It is used to make a new directory.
- rmdir : If you need to delete a directory, use the rmdir command.
- rm : It is used to delete directories and the contents within them.
- touch : It allows you to create a blank new file (If already created then it will change the timestamp) through the Linux command line.
- find : It is used for searches for files and directories.
- grep : It is used for search through all the text in a given file.
- sudo : This command enables you to perform tasks that require administrative or root permissions.
- df : It is used to get a report on the system’s disk space usage, shown in percentage and KBs.
- du : It is used to check how much space a file or a directory takes.
- chmod : It is used to change the read, write, and execute permissions of files and directories.
- chown : It enables you to change or transfer the ownership of a file to the specified username.
- ping : It is used to check your connectivity status to a server.
- man : you can easily learn how to use them right from Linux’s shell by using the man command.
- hostname : If you want to know the name of your host/network simply type hostname.
- useradd : It is used to create a new user.
- passwd : It is used to adding a password to that user’s account.
- history : If you want to review the commands you’ve entered before type history.
- 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.