Skip to main content

RH033 Real Exam Questions

Red Hat Linux Essentials

153 questions available · Page 1 of 16

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Multiple choice

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working as a root user on the Linux operating system. Which of the following commands will John use to display information about all mounted file systems?

Each correct answer represents a complete solution. Choose all that apply.

  1. A

    df

  2. B

    du

  3. C

    ls

  4. D

    df -m

Show answer and explanation

Correct answers: A, D

Explanation

According to the scenario, John can use any of these two commands. The df command will display information about all mounted file systems in KB while the df -m command will display information in MB.

Question 2 Single choice

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working as a root user on the Linux operating system. He wants to change the group membership of the file foo to group bar.

Which of the following commands will he use to accomplish the task?

  1. A

    chgrp foo bar

  2. B

    chgroup bar foo

  3. C

    chgrp bar foo

  4. D

    chgroup foo bar

Show answer and explanation

Correct answer: C

Explanation

According to the scenario, John will use the chgrp bar foo command to accomplish the task. The chgrp (from change group) command is used by unprivileged users to change the group associated with a file.
Unlike the chown command, chgrp allows regular users to change groups, but only to one of which they are a member. The general syntax of the chgrp command is as follows:
chgrp group target1 [target2 ..]
The group parameter indicates the new group with which the targets should be associated. The target1 parameter indicates the files or directories for which the change should be made.
The target2 parameter indicates the optional additional files or directories for which the change should be made.
For example:
The above command changes the group associated with ttt to 'system', provided the executing user is a member of that group.
Answer option A is incorrect. In the chgrp command, first we write the group name and after that, we write the file name. But here just the opposite is written, so this command will not give the desired result.
Answer options D and B are incorrect. There is no such command as chgroup in Linux.

Question 3 Single choice

You work as a Network Administrator for company.com Inc. The company has a Linux-based network.
You are working as a root user on the Linux operating system. You want to rearrange the order of jobs in a spooling queue according to your requirement.

Which of the following commands will you use to accomplish the task?

  1. A

    lpq

  2. B

    lpc

  3. C

    lprm

  4. D

    lpr

Show answer and explanation

Correct answer: B

Explanation

The lpc command can be used to rearrange jobs awaiting printing, as well as to disable/enable a printer or queue and find the status of printers.
Answer option D is incorrect. The lpr sends a job to the queue to be printed. Answer
option A is incorrect.
The lpq views the contents of the queue. Answer option C is incorrect. The lprm removes a job from the queue.

Question 4 Single choice

Which of the following commands is used to make traceroute wait 5 seconds for a response to a packet?

  1. A

    traceroute -w

  2. B

    traceroute -T

  3. C

    traceroute -q

  4. D

    traceroute -r

Show answer and explanation

Correct answer: A

Explanation

The traceroute -w command is used to make traceroute wait 5 seconds (default) for a response to a packet.
What is traceroute?
Traceroute is a route-tracing utility that displays the path an IP packet takes to reach its destination.
It uses Internet

Control Message Protocol (ICMP) echo packets to display the Fully Qualified Domain Name (FQDN) and the IP address of each gateway along the route to the remote host. Traceroute sends out a packet to the destination computer with the TTL field value of 1. When the first router in the path receives the packet, it decrements the TTL value by 1. If the TTL value is zero, it discards the packet and sends a message back to the originating host to inform it that the packet has been discarded. Traceroute records the IP address and DNS name of that router, and sends another packet with a TTL value of
2. This packet goes through the first router, and then times out at the next router in the path. The second router also sends an error message back to the originating host. Now, the process starts once again and traceroute continues to send data packets with incremented TTL values until a packet finally reaches the target host, or until it decides that the host is unreachable. In the whole process, traceroute also records the time taken for a round trip for each packet at each router.
Answer option B is incorrect. The traceroute -T command uses the TCP/SYN packets for probing.
Answer option C is incorrect. The traceroute -q command sets the number of probe packets per hop.
The default value is 3.
Answer option D is incorrect. The traceroute -r command bypasses the normal routing tables and sends the probe packet directly to a host on an attached network. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it.

Question 5 Single choice

You work as the Network administrator for McNeil Inc. The company has a Linux-based network. You are working as a root user on the Linux operating system. You have created a PostScript file on your system.
You want to convert this file to a PDF file.

Which of the following commands should you use to accomplish the task?

  1. A

    ps2pdf

  2. B

    evince

  3. C

    pdf2ps

  4. D

    enscript

Show answer and explanation

Correct answer: A

Explanation

The ps2pdf utility is used to convert PostScript to a PDF file.
What is a ps2pdf command?
The ps2pdf command creates PDF files. It is used to convert a PostScript file to a PDF file. There are a number of versions of this program, some are as follows:

Answer option D is incorrect. The enscript utility converts a text to a PostScript format and sends it to a file or the print queue.
Answer option B is incorrect. The evince utility is used to view a PDF file, not to create a PDF file.
What is the evince command?
The evince command is a document viewer capable of displaying multiple and single page document formats such as PDF and Postscript.
Syntax: evince [Options] [Filename]

Question 6 Multiple choice

Which of the following information does the /etc/passwd file contain? Each correct answer represents a complete solution. Choose all that apply.

  1. A

    Numerical group ID

  2. B

    User name

  3. C

    Shadow password

  4. D

    Numerical user ID

  5. E

    Reserved gecos ID

  6. F

    User's home directory

Show answer and explanation

Correct answers: A, B, D, E, F

Explanation

All these information are stored in the /etc/passwd file.
What is the /etc/passwd file?
In Linux operating systems, the /etc/passwd file lists information about each of the users that may login to the system. The file is so named because originally it also contained the data used to verify passwords.
However, on modern Unix systems, the security-sensitive password information is instead often stored in a different file using shadow passwords.
The /etc/passwd file typically has world-readable permissions, though it may only be edited by the superuser or by using a few special purpose commands. The first field is the user name. Each record in the file must have a unique user name field. The second field stores information used to confirm a user's password; however, in most modern uses, this field is usually set to "x" (or some other indicator) with the
actual password information being stored in a separate shadow password file. The third field is the user identifier, the number that the operating system uses for internal purposes. It does not have to be unique.
The fourth field is the group identifier. This number identifies the primary group of the user; all files that are created by this user will initially belong to this group. Reserved gecos ID (Typically, this is a set of comma-separated values including the user's full name and contact details).
The sixth field is the path to the user's home directory. The seventh field is the shell program that is started every time the user logs into the system.
Answer option C is incorrect. The shadow password is stored in the /etc/shadow file.
What is /etc/shadow file?
The /etc/shadow file stores the account information in the following format:

Question 7 Single choice

Which of the following commands will you use to change the home directory of a user and move all of its contents to the new home directory?

  1. A

    usermod -d -m

  2. B

    usermod -g

  3. C

    usermod -o -u

  4. D

    usermod -u

Show answer and explanation

Correct answer: A

Explanation

The usermod -d -m command is used to change the home directory of a user as well as move all of its contents to the new home directory.

Question 8 Single choice

Which of the following commands will you execute to fix other writable files in your home directory?

  1. A

    find -perm -002 -exec chmod o-w {} \;

  2. B

    find /home -type d -ls

  3. C

    find ~ -perm -002 -exec chmod o-w {} \;

  4. D

    find ~ -perm -002 -exec chmod -w {} \;

Show answer and explanation

Correct answer: C

Explanation

You will use find ~ -perm -002 -exec chmod o-w {} \; command to fix other writable files in your home
directory.
Answer option B is incorrect. The find /home -type d -ls command is used to do an ls -l style listing of all directories in /home/.
Answer options A and D are incorrect. There are no such commands in Linux.

Question 9 Multiple choice

Which of the following commands are used to remove a package from a Linux system?

Each correct answer represents a complete solution. Choose two.

  1. A

    yum -rm packagename

  2. B

    yum remove packagename

  3. C

    yum -r packagename

  4. D

    yum erase packagename

Show answer and explanation

Correct answers: C, D

Explanation

The yum remove packagename and yum erase packagename commands are used to remove a specified package from a Linux system. If any packages depend on this package, yum will prompt about this and give the option to remove those packages too. Answer options A and C are incorrect. These commands are incorrect. The -r and -rm options are not used with the yum command to remove a package from a Linux system.

Question 10 Single choice

You work as a network administrator for company Inc. The company has a Linux-based network. You want to create a file named foobar.zip and put it into a directory named filesdir.

Which of the following commands will you use to accomplish the task?

  1. A

    unzip foobar.zip filesdir

  2. B

    zip -r foobar.zip filesdir

  3. C

    tar -tvf foobar.tar

  4. D

    gunzip foobar.zip

Show answer and explanation

Correct answer: B

Explanation

The zip -r foobar.zip filesdir command is used to create a file named foobar.zip and put it into the directory named filesdir. foobar.zip represents the file you are creating and filesdir represents the directory you want to put in the new zip file. The -r option specifies that you want to include all files contained in the filesdir directory recursively. Answer option A is incorrect. The unzip foobar.zip command is used to extract the contents of a zip file to the filesdir directory.
Answer option D is incorrect. The gunzip foobar.zip command is used to expand the compressed file.
Answer option C is incorrect. The tar -tvf foobar.tar command is used to list the contents of a tar file.