Red Hat Enterprise Linux Interview Questions and Answers
When we talk about GNU/LINUX distributions we find a big collection of them, which can cover practically all the needs in almost all areas. Some of them range from simple home use to commercial production. The GNU/LINUX distribution that we will be talking about not only has a great impact on the “penguin” world, but also on the business sector is an obligatory reference because of its stability, commercial support and solutions applied to the cloud. Welcome to Red Hat Enterprise Linux. This article is about Red Hat Enterprise Linux Interview Questions and Answers that will help you to crack your technical round of Linux interviews.
Red Hat Linux Interview Questions and Answers
1. What is Red Hat Enterprise Linux?
Answer – It is a GNU/LINUX distribution created and developed by the multinational enterprise oriented company Red Hat, being the basis for deploying cloud applications, servers or data center.
2. Which is the package manager used by RHEL?
Answer – The package manager in RHEL is YUM.
3. How do I install a program in RHEL?
Answer – Installing a package or program in RHEL is simple thanks to YUM. With root permission we type in a terminal.
yum install package_name
4. How can I update the packages in RHEL?
Answer – Run below command to update all packages in your RHEL system.
5. How can I remove the packages in RHEL?
Answer – Run below command to remove any package from RedHat Linux system.
#Make sure to change the name of package that needs to be removed. yum remove package_name
6. How can I create a user in RHEL?
Answer – We can create a new user from the terminal with the command:
#Pass the user name in place of user_name useradd user_name
7. How can I change the user password?
Answer – The command that allows us to change the password of the active user is passwd. By entering the command in the terminal, you will be prompted for the current password and twice for the new password. Read below article to learn step by step process to change user as well as sudo passwords.
8. How can I change the system language?
Answer- In RHEL, the system language can be changed using the following command:
localectl set-locale LANG=”xx_XX.utf8”
For example, if the system is in English and we want to change to German
localectl set-locale LANG=de_DE.utf8
Then simply restart the active session (not the system)
9. What is a GNU/LINUX service?
Answer – A service is a program that runs in the background, outside the interactive control of the users of the system.
10. How can I list the services that are running in RHEL?
Answer – This is very useful when managing systems in GNU/LINUX. We can list all the services that are running with the command:
systemctl -t service --state=active
If you want to check specific service running on RHEL then you can pass service name in above command. For example, i want to check SQL Server service running on my RHEL system then i will run below command. This command will show the output for only this service.
systemctl status mssql-server
11. How can I start or stop a service?
Answer – During the administration of a GNU/LINUX based server we will have to initialize and also stop services.
systemctl start name.service
systemctl stop name.service
systemctl restart name.service
12. How do I know which version of the kernel I am using?
Answer – To know which version of the Linux Kernel we are using, just use the command:
13. How can I add and remove kernel modules?
Answer – The kernel modules are small programs or libraries that are added to the kernel so that it can manage hardware devices. To add or remove it we use the command modprobe.
For example, to add a module:
And to remove a module
modprobe –r module_name
14. What is the file system RHEL uses?
Answer – The file system used by RHEL is XFS
15. How do I know how much space is available on my hard disk with RHEL?
Answer – This is useful to know when we are reaching the hard disk capacity. With the command:
16. Can I change hostname in RHEL?
Answer – Yes. There are multiple ways to change hostname of a RHEL system. For example if we want hostname to be example. com, we must write the following command in a terminal:
hostnamectl set-hostname example.com
I have explained it in below article in very details way. Have a look at this article to learn the process to rename or change the hostname of RHEL system.
17. How do I know the IP address of the equipment in RHEL?
Answer – With the command:
nmcli dev show
We will not only be able to see the ip address, but also the complete information of all the network interfaces. You can read below article to learn how to check and change the IP address, subnet mask etc of a RHEL system.
18. Can I install a Web server in RHEL?
Answer- Of course, we can install the web server we want: Apache, nGix or other.
19. After installing Apache2, where is the default Document Root located?
Answer – By default the apache2 DocumentRoot in RHEL sets it to /var/www/html/
20. How do I know which version of Red Hat Enterprise Linux is running the server?
Answer – Run the command in a terminal to get the RHEL version running on your system.