Red Hat Linux MCQs

Red Hat Linux MCQs

Try to answer these 200+ Red Hat Linux MCQs and check your understanding of the Red Hat Linux subject.
Scroll down and let's begin!

1: Where do the manual (man) pages for all commands reside in the File System Hierarchy (FSH)?

A.   /usr/share/man

B.   /usr/share/info/man

C.   /usr/share/locale/man

D.   /usr/man/share/locale

2: Which (free) linux distro is derived from RHEL

A.   Mint

B.   Ubuntu

C.   Debian

D.   CentOS

3: Which is not a valid priority in syslogd.conf?

A.   notice

B.   news

C.   debug

D.   alert

4: To configure networking via a console GUI you can use:

A.   system-config-network

B.   system-config

C.   network-config

D.   networking config

5: How to show currently loaded kernel modules?

A.   kernshow

B.   lsmodules

C.   modshow

D.   modprobe

E.   lsmod

6: To find the version of redhat in use you can:

A.   uname -a

B.   none will work

C.   cat /etc/redhat-release

D.   either will work

7: Which statements are true about a source RPM?

A.   Source RPM does not contain information about how to install the software.

B.   Source RPMs can be compiled and installed directly.

C.   Source RPM cannot be used to build a binary rpm.

8: How would you create a disk dump in RedHat Linux?

A.   dd if=/dev/sda of=/dev/sdb

B.   restore /dev/sda /dev/sdb

C.   fsck2 /dev/sda /dev/sdb

D.   dump /dev/sda ssh@localhost:/dev/hda

E.   mk4ext /dev/sda /dev/sdb

9: what does the following command do? "watch -n 1 du -hs /tmp/file"

A.   waits till the file /tmp/file gets created befor checking the size

B.   all of the above

C.   It runs the command du -hs /tmp/file every second and updates the output

D.   none of the above

10: What does the "tcpdump" command do?

A.   Captures traffic on a network

B.   Lists All TCP and UDP connections.

C.   Lists All TCP connections.

D.   Terminates all TCP connections on the target host.

11: Using cat command, which option is used to print the line number?

A.   cat -A filename

B.   cat -n filename

C.   cat count number filename

D.   cat -number filename

E.   cat -l filename

12: How to find out memory usage:

A.   vmstat

B.   All are correct

C.   cat /proc/meminfo

D.   top

E.   free -m

13: To verify what state (run level) you are currently running in, you use:

A.   runlevel

B.   init

C.   telinit

D.   chkstate

14: You use samba to:

A.   share resources (like printers) between a Windows and Linux machines

B.   mount Windows filesystems on Linux machines

C.   none are correct

D.   both are correct

15: What is pNFS means?

A.   Parallel Network File System

B.   peripheral Network File System

16: The following entry appears in the /etc/crontab as follows: 30 4 * * 1 /bin/sh /home/Tom/rmcore 2>&1 /dev/null

A.   "rmcore" will execute on the first day of every month

B.   "rmcore" will execute every Monday at 4:30 a.m.

C.   "rmcore" will execute on April 30th for one hour

17: Using scp to copy a file "test_file" from your machine to the remote machine "test_machine" to the /tmp directory, using the account "test_user" on the remote machine, you do:

A.   scp test_file:test_user@test_machine:/tmp

B.   scp test_file test_machine@test_user:/tmp

C.   scp -f test_file -u test_user -m test_machine -d /tmp

D.   scp test_file test_user@test_machine:/tmp

18: How would you find out the dependencies of RPM package?

A.   #rpm -UVH

B.   #rpm -ivh

C.   #rpm -icv

D.   #rpm -qR

E.   #rpm -nogpg

19: To power down the system, you use:

A.   shutdown -h now

B.   telinit 0

C.   all are correct

D.   shutdown -h +1

20: Larry, working as root, needs to change the ownership of the file "myfile" from "james" to "mary." He should:

A.   chown mary myfile

B.   chown myfile james:mary

C.   chown james:mary myfile

D.   changeowner mary myfile

21: Which Standard does pNFS Stands for..

A.   NFS 4

B.   NFS 3

C.   NFS 4.1

22: If you set your /etc/inittab file to have the default init entry to be 'init:3:default:', then your system default runlevel is:

A.   administrative single-user mode; denies other users access to the system, but allows root access to the entire multiuser file system. Startup scripts are not run

B.   multiuser, without networking (i.e., you don't have access to network services like NFS, xinetd, and NIS)

C.   full multiuser mode with login to command-line interface; allows remote file sharing with other systems on your network. Also referred to as the text mode state

D.   full multiuser mode that starts up in an X session, initiating a graphical login; allows remote file sharing with other systems on your network

23: What is the tee command?

A.   send errors to a file

B.   create marks on a file

C.   translate characters in a file

D.   split standard output to a file

24: 'xhost +' is a security problem because:

A.   this command does not pose any security risks

B.   any user with access to the system could connect to your X display

C.   any user on remote machines could open a remote connection to your system with rsh or ssh

D.   any host on the network could assume your IP system address

25: You configure an OpenSSH server in the file:

A.   /etc/ssh/sshd_config

B.   /etc/sshd/sshd.config

C.   /etc/sshd_config

D.   /etc/ssh/sshd.conf

26: Which mode provides load balancing and fault tolerance in ethernet bonding ?

A.   Round Robin

B.   802.3ad

C.   balance-tlb

D.   balance-alb

E.   balance-xor

27: The user smith issued the egrep "^[[: upper:]]" words.txt command. What does this command do?

A.   displays all lines in the words.txt file that begins with an uppercase letter

B.   displays all lines in the words.txt file after translating uppercase letters to lowercase

C.   displays all lines in the words.txt file that contains an uppercase letter

D.   displays all lines in the words.txt file after translating lowercase letters to uppercase

28: What is the purpose of the file /etc/updatedb.conf?

A.   configuration file for software updates

B.   configuration file for driver updates

C.   configuration file for kudzu

D.   configuration file for mlocate package

29: Identify the true statement about configure script.

A.   It does not depend on the autoconf tool for the package installation.

B.   It creates the necessary Makefiles based on the user information.

C.   It creates the required directories and subdirectories on the system.

D.   It depends on make to create the Makefiles.

30: If umask is 0022, what is the by default permission of a file?

A.   755

B.   777

C.   644

D.   655

E.   744

31: For all filesystems listed in /etc/mtab, to display the total space allowed for a user or group, you use the command:

A.   quota

B.   du

C.   usage

D.   df

32: Which of the following are valid iptable chains?

A.   Through, In, Out

B.   None of the above

C.   All of the above

D.   Forward, Input, Output

E.   Accept, Drop, Reject

33: Which command is used to kill a process gracefully?

A.   pkill -9 <PID>

B.   kill -9 <PID>

C.   kill -g <PID>

D.   kill -15 <PID>

E.   pkill -G graceful <PID>

34: Which of the following options is true of the entry below? /dev/cdrom /cd iso9660 ro,user,noauto 0 0

A.   This is an "fstab" entry which lets any user mount the CD-ROM.

B.   This is an "fstab" entry which mounts a CD-ROM as a read-only device at boot time.

C.   This is an "mtab" entry which mounts a CD-ROM as a read-only device at boot time.

35: What command will free the page cache?

A.   echo 2 > /proc/sys/vm/drop_caches

B.   echo 1 > /proc/sys/vm/drop_caches

C.   echo 3 > /proc/sys/mem/drop_caches

D.   echo 0 > /proc/sys/vm/drop_caches

36: What is the default maximum number of open files a user can have by default?

A.   1024

B.   4096

C.   8192

D.   unlimited

E.   2048

37: You use the SUSPEND character to suspend an already running process. Which signal does it send to the process?

A.   SIGINT

B.   SIGHUP

C.   SIGSTOP

D.   SIGTERM

38: System-wide values used by user and group creation utilities such as useradd and usergroup are kept in the file:

A.   /etc/user.def

B.   /sbin/passwd.defs

C.   /etc/usergrp

D.   /etc/login.defs

39: When mounting a volume listed in "fstab",

A.   it suffices to give only the mount point

B.   both the device and mount point must be given on the command line.

40: What file is used for 'HOSTNAME' configuration?

A.   /etc/sysconfig/network

B.   /etc/resolv.conf

C.   /etc/sysconfig/networking

D.   /etc/hosts

E.   /etc/hostname

41: How to find out what packages are currently installed?

A.   rpm -q

B.   yum list installed

C.   yum list --installed

D.   rpm -a

E.   yum info --installed

42: Which statement is true about the files and directories created inside the /project directory that have 2777 permissions?

A.   All files and directories will have the default group set to the primary group of the user who creates them in /project directory.

B.   All executables inside the /project directory will run with the effective group ID (EGID) of the group of the /project directory.

C.   All files inside the /project directory will have permissions set to 2644 and the subdirectories will have them set to 2755.

D.   All files and directories will have the same group as that of the /project directory.

43: The /projects directory is being shared by server1 with the share name datashare through samba. To access the shared directory as bob you issue the following command: smbclient //server1/datashare -U 'bob%foouser' What happens when you execute the command?

A.   The share will be accessed with the credentials of bob without being prompted for a password.

B.   All the samba shares on server1 will be displayed.

C.   bob will be prompted for a password to access the share.

D.   All the shares on server1 accessible to bob will be displayed.

44: Which service lets you edit qcow2 images in Linux ?

A.   guestfish

B.   none of them

C.   virt-manager

D.   both virsh & virt-manager

E.   virsh

45: The line '0 2 * * 1-5 tar cf /home/backp /home/projects' in a crontab will:

A.   back up the projects directory at 2:00 A.M. from Sunday to Thursday

B.   back up the projects directory at 2:00 A.M. every weekday

C.   back up the projects directory at 2:00 P.M. from Sunday to Thursday

D.   back up the projects directory at 2:00 P.M. every weekday

46: Which kernel parameter is used to reset root password in RHEL7

A.   both 1 & single

B.   rd.break

C.   single

D.   1

E.   one

47: To change the system runlevels, you use:

A.   runlevel

B.   setinit

C.   telinit

D.   initd

48: How to kill user session?

A.   kill -9 -u username

B.   pkill -9 -u username

C.   pskill username

D.   kill username

49: What file will show you with what options kernel was started?

A.   /boot/kern_start

B.   /proc/cmdline

C.   /proc/start

D.   /var/log/messages

50: If you use 'shutdown now', it will:

A.   print a warning to all active terminals and then halt the system

B.   transfer your system into maintenance mode

C.   reboot the system

D.   shut down the system