Red Hat Enterprise Linux Essentials - 033

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Panku
P
Panku
Community Contributor
Quizzes Created: 2 | Total Attempts: 921
| Attempts: 729 | Questions: 25
Please wait...
Question 1 / 25
0 %
0/100
Score 0/100
1. Write down the command to view the calendar of January 2010.

Explanation

The command "cal 01 2010" and "cal 1 2010" are both correct answers because they both specify the month and year (January 2010) to view the calendar. The "cal" command is used to display a calendar in the terminal, and the format for specifying the month and year is either with leading zeros (01) or without leading zeros (1).

Submit
Please wait...
About This Quiz
System Administration Quizzes & Trivia

This quiz covers essential aspects of Red Hat Enterprise Linux, including system commands, file operations, and configuration management.

2. In the file /etc/sysconfig/network-scripts/ifcfg-eth0, which variable is modified to the value "dhcp" in order to get the IP address automatically from DHCP server? (write the name of variable in capital letters only).

Explanation

The variable that needs to be modified to "dhcp" in order to get the IP address automatically from the DHCP server is BOOTPROTO.

Submit
3. What type of files are typically in the /etc directory?

Explanation

The /etc directory typically contains configuration files. These files store settings and parameters for various programs and services on a Linux system. They are used to customize the behavior and functionality of the system and its applications. Examples of configuration files commonly found in the /etc directory include network configuration files, user account settings, system startup scripts, and package manager configurations.

Submit
4. Where is the configuration information for network interface eth0 stored?

Explanation

The configuration information for network interface eth0 is stored in the file /etc/sysconfig/network-scripts/ifcfg-eth0.

Submit
5. Which of the following run level reboot the machine?

Explanation

Run level 6 is the correct answer because it is specifically designated for rebooting the machine. In Unix-like operating systems, each run level has a specific purpose, and run level 6 is reserved for system reboot. When the system enters run level 6, it initiates the reboot process, shutting down all running processes and restarting the machine. The other run levels listed (0, 4, 2, and 1) have different purposes such as shutting down the system, multi-user mode, or single-user mode, but run level 6 is specifically used for rebooting.

Submit
6. In which of the following file can you set the default run-level?

Explanation

In the given options, the correct file to set the default run-level is /etc/inittab. This file is used by the init process to determine the default run-level for the system. It contains configuration information for initializing and controlling the system during the boot process.

Submit
7. Write down the file in which DNS configuration are made.

Explanation

The DNS configuration is made in the file "/etc/resolv.conf". This file contains information about the DNS servers that the system should use to resolve domain names to IP addresses. By editing this file, users can specify the DNS server addresses, search domains, and other DNS settings for their system.

Submit
8. What will the following command do:
find -size 1024k exec rm -f {} \;

Explanation

The given command "find -size 1024k exec rm -f {} \;" is using the "find" command to search for files with a size of exactly 1 megabyte (1024 kilobytes) and then executing the "rm -f" command to delete those files. Therefore, the command will delete the file/s that are exactly 1 megabyte in size.

Submit
9. If the file newdir/file2 does not exist but the directory newdir does exist, what is the effect of the following command? mv file1 newdir/file2

Explanation

The command "mv file1 newdir/file2" will move the file named "file1" to the directory "newdir" and rename it as "file2". This means that the original file "file1" will no longer exist in its original location and can now be found in the "newdir" directory with the new name "file2".

Submit
10. Which of the following commands could be used to configure a system's date and time?

Explanation

The correct answer is "date". The "date" command is commonly used in Unix-like operating systems to display or set the system's date and time. By running the "date" command with appropriate options and arguments, users can view the current date and time, as well as modify them to set a new date and time.

Submit
11. Consider the following command:

[root@localhost ~]# echo $?
0

What does the output“0” indicates?


 

Explanation

The output "0" indicates that the last command was successful.

Submit
12. Consider the following scripts:

echo "Enter the username:"
read NAME
useradd $NAME
echo $NAME | passwd $NAME --stdin

What will be the password if I run the above script and enter the username as 'abc'?

Explanation

The password will be 'abc' because the script uses the 'useradd' command to create a new user and the 'passwd' command to set the password. The password is set to the value of the variable '$NAME', which is 'abc' in this case.

Submit
13. Consider the following command:

[root@localhost ~]#  cat  /etc/passwd | grep root | cut -d: -f1,7
What will be the output?

Explanation

The given command is using the "cat" command to display the contents of the "/etc/passwd" file. The output of this command is then piped "|" to the "grep" command, which searches for lines containing the word "root". The output of the "grep" command is then piped "|" to the "cut" command, which uses ":" as the delimiter and selects the first and seventh fields from each line. Therefore, the output will be "root: /bin/bash", which represents the username "root" and the shell "/bin/bash".

Submit
14. In the following shell script, how many times will the date command run?

for i in a b; do date; done

Explanation

The date command will run 2 times in the given shell script. This is because the script uses a for loop to iterate through the values "a" and "b". For each iteration, the date command is executed, resulting in a total of 2 executions.

Submit
15. Consider the following file:

[root@localhost ~]# cat example
b
A
a
f
c
e
d
4
33
1
5
2
a

What will be the output of below command? Why?

cat example | sort | uniq -d

Explanation

The correct answer is "a, because a is repeated twice." This is because the command "cat example | sort | uniq -d" is used to display the duplicate lines in the file "example". The output will be the lines that are repeated in the file, and in this case, the letter "a" is repeated twice.

Submit
16. What umask setting wouls be required to give, when creating a directory, read/write/execute for yourself, read & execute for group but only execute for others?

Explanation

The umask setting determines the default permissions for newly created files and directories. In this case, a umask setting of 026 would be required. This means that when creating a directory, the owner would have read, write, and execute permissions (7), the group would have read and execute permissions (5), and others would have only execute permissions (6).

Submit
17. What command will you type to install linux using CLI?

Explanation

To install Linux using the command line interface (CLI), you would type "linux text" in the command prompt. This command initiates the installation process in text mode, allowing you to install Linux without a graphical user interface (GUI). By using the "linux text" command, you can install Linux on a system that may not have the necessary hardware or resources to support a GUI-based installation.

Submit
18. What command will be run by this sequence?

[root@localhost ~]# !?cat

Explanation

The given sequence [root@localhost ~]# !?cat will run the most recent command that has "cat" in the command name. This means that if there was a previous command that included "cat" in its name, the sequence will run that command.

Submit
19. How many fields (columns) are there in /etc/shadow and /etc/gshadow respectively?

Explanation

The correct answer is 9, 4. In the /etc/shadow file, there are 9 fields or columns, which include the username, encrypted password, last password change date, minimum password age, maximum password age, password warning period, password inactivity period, account expiration date, and reserved field. In the /etc/gshadow file, there are 4 fields or columns, which include the group name, encrypted password, list of group administrators, and list of group members.

Submit
20. Consider a directory /root/dropzone. Which amongst the following permissions should be set up so that group and others can save files in the directory, but they cannot read the files that are there? Root must be able to read and write the directory.

Explanation

The correct answer is "drwx-wx-wx". This permission setting allows the group and others to save files in the directory ("/root/dropzone") by having write access, but they cannot read the files that are already there as they do not have read access. Root, however, can still read and write to the directory as it has full permissions.

Submit
21. Suppose you want to view the man page for the gshadow file format. How might you do that?

Explanation

To view the man page for the gshadow file format, you would use the command "man 5 gshadow". The "man" command is used to display the manual pages for various commands and topics, and the number "5" specifies the section of the manual where the gshadow file format is documented. By typing this command, you can access the specific information about the gshadow file format.

Submit
22. For the file reports.txt, which of the following commands would, ignoring case, extract every line containing the word "expense", the lines before and after each match, and print the relevant line numbers?

Explanation

The correct answer is "grep -A1 -B1 -n -i expense reports.txt". This command will search for the word "expense" in the file "reports.txt" while ignoring case. It will also print the line numbers of the relevant lines. Additionally, it will print the line before and after each match using the options -A1 and -B1 respectively.

Submit
23. Which among the following file should be modified in order to make the permanent configuration to the vim editor?

Explanation

To make permanent configurations to the vim editor, either the .vimrc or .exrc file should be modified. These files contain settings and customization options for the vim editor. Modifying either of these files allows users to set preferences such as key mappings, syntax highlighting, and other editor configurations. By making changes to these files, users can ensure that their preferred settings are applied every time they use the vim editor.

Submit
24. Consider the following file:

[root@localhost ~]# cat cats
cat
catalog
concatenate
polecat
Cat

What will be the output when you fire the below command:
sed  ‘s/[Cc]at$/dog/’ cats.

Explanation

The sed command is used to perform text transformations on a file. In this case, the command 's/[Cc]at$/dog/' is used to replace the word 'cat' or 'Cat' at the end of a line with the word 'dog'.

The given file contains the following lines:
- cat
- catalog
- concatenate
- poledog
- cat

When the sed command is applied to this file, the word 'cat' at the end of the first line is replaced with 'dog'. The rest of the lines remain unchanged. Therefore, the output will be:
- dog
- catalog
- concatenate
- poledog
- cat

Submit
25. Choose the inappropriate option regarding the at and crontab.

Explanation

not-available-via-ai

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 29, 2009
    Quiz Created by
    Panku
Cancel
  • All
    All (25)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Write down the command to view the calendar of January 2010.
In the file /etc/sysconfig/network-scripts/ifcfg-eth0, which variable...
What type of files are typically in the /etc directory?
Where is the configuration information for network interface eth0...
Which of the following run level reboot the machine?
In which of the following file can you set the default run-level?
Write down the file in which DNS configuration are made.
What will the following command do:find -size 1024k exec rm -f {} \;
If the file newdir/file2 does not exist but the directory newdir does...
Which of the following commands could be used to configure a system's...
Consider the following command:[root@localhost ~]# echo $?0What does...
Consider the following scripts:echo "Enter the username:"read...
Consider the following command:[root@localhost ~]#  cat ...
In the following shell script, how many times will the date command...
Consider the following file:[root@localhost ~]# cat...
What umask setting wouls be required to give, when creating a...
What command will you type to install linux using CLI?
What command will be run by this sequence? [root@localhost ~]# !?cat
How many fields (columns) are there in /etc/shadow and...
Consider a directory /root/dropzone. Which amongst the following...
Suppose you want to view the man page for the gshadow file format. How...
For the file reports.txt, which of the following commands would,...
Which among the following file should be modified in order to make the...
Consider the following file:[root@localhost ~]# cat...
Choose the inappropriate option regarding the at and crontab.
Alert!

Advertisement