Linux – Multiple Choice Questions – MCQ – 361 to 390 Questions with Explanation

361. You are told by a co-worker that information pertaining to the syslog command can be found in man page 3. How would you view this information?

A. man syslog 3
B. man syslog -3
C. man -3 syslog
D. man 3 syslog

Answer – – D
Description – The man page can be specified using the syntax man NUMBER command. This correct syntax is shown as man 3 syslog.

362. Which command is not used to view the contents of a file?

A. cat
B. more
C. less
D. expand

Answer – – D
Description – The cat, more, and less utilities are all used to view file contents. The expand utility is used to convert tab characters to spaces.

363. The ________ command is used to unmount a file system.

Answer – – umount
Description – File systems are unmounted using the umount command.

364. The ________ command will display previously entered commands.

Answer – – history
Description – The history command allows you to view previously entered commands.

365. What type of information might you find using

A. man pages
B. Usenet postings
C. software patches
D. kernel updates

Answer – – B
Description – The Web site enables you to search Usenet postings.

366. Which directory utilizes no disk space?

A. /proc
B. /boot
C. /root
D. /local

Answer – – A
Description – The /proc directory is virtual. It is used to store information about system resources and processes.

367. The __________ command is used to perform a consistency check on file systems.

Answer – – fsck
Description – The fsck utility is used to verify and correct problems on file systems.

368. Which command would create a file called mydirlisting that includes a detailed listing of all the files and directories located within your home directory?

A. ls -alR $HOME > mydirlisting
B. ls -d > mydirlisting
C. mydirlisting < ls -al $HOME
D. ls -al | mydirlisting

Answer – – A
Description – The -R option specifies that a recursive directory listing be performed. Data is sent to a file when the > symbol is used for redirection.

369. The ________ command is used to create an ext2 file system.

Answer – – mkfs
Description – The mkfs tool is used to create a file system.

370. You’re repairing the master boot record on a system. You have booted the system via a boot disk and currently have the root volume mounted to /recover. How would you reinstall LILO?

A. lilo -r /recover/boot
B. lilo -f /recover
C. lilo -r /recover
D. lilo -r /recover -b /recover/boot

Answer – – C
Description – The -r parameter on lilo specifies a different root directory. This is used when you are doing recovery and /etc and /boot are actually mounted under a new root.

371. The __________ file needs to be updated when a new library is added.

Answer – –
Description – Whenever a new library is added manually, you must edit the file and run ldconfig.

372. Which command removes a package named editor-2.0.i386.rpm?

A. rpm -i editor-2.0.i386.rpm
B. rpm -e editor-2.0.i386.rpm
C. dpkg -install editor-2.0.i386.rpm
D. apt-get install editor-2.0.i386.rpm

Answer – – B
Description – The -e parameter is used to remove a package with RPM. The other choices install packages.

373. To make a single change to the kernel configuration before compiling, you would edit which file?

A. /usr/src/linux/Makefile
B. /usr/src/linux/.config
C. /usr/src/linux/config
D. /usr/src/linux/configure

Answer – – B
Description – By default, kernel configuration options are stored in the .config file.

374. Which command will tell you which package owns the file /etc/printcap?

A. dpkg -F /etc/printcap
B. rpm -f /etc/printcap
C. who /etc/printcap
D. rpm -qf /etc/printcap

Answer – – D
Description – The -qf parameters tell RPM to query (-q) the database to see who owns a certain file (-f).

375. The __________ file is executed for all nonlogin bash sessions.

Answer – – ~/.bashrc or /etc/bashrc.
Description – The .bashrc script is executed when a bash shell is started, but not when logging in. For example, if you open a new xterm in X11 with bash, this script will run.

376. Which command shows the route between your host and the remote host

A. traceroute -n
B. route
C. ping -r
D. route -n

Answer – – A
Description – traceroute is used to show the path a packet takes to a destination. The ping command tells you only if a remote host is up, and the route command is used to modify the local routing table.

377. Which command is the best to use to find a contact name for another domain?

A. nslookup
B. whoinfo
C. whois
D. dig

Answer – – C
Description – The whois command shows contact information relating to a domain. The nslookup and dig tools are used to check DNS information. The whoinfo command is invalid.

378. Which command(s) must be run after the inetd.conf file is updated?

A. /etc/rc.d/init.d/inetd restart
B. kill -1 inetd
C. kill -1 `cat /var/run/`
D. No command needed.

Answer – – A and C
Description – When a change is made to inetd.conf, the daemon must be restarted by either using the script or issuing a HUP.

379. The __________ file can be created to keep nonroot users from logging in to the system.

Answer – – /etc/nologin.
Description – This file causes the system to disallow all nonroot logins.

380. Which command(s) is/are used to enable shadow passwords?

A. shadow
B. pw-conv
C. pwconv
D. grpconv

Answer – – C and D
Description – The pwconv and grpconv tools convert the passwd and group files to use shadow passwords. The other commands are fake.

381. Which command(s) is/are used to decompress the file mydoc.gz?

A. gunzip mydoc.gz
B. tar -zxv mydoc.gz
C. gzip -d mydoc.gz
D. gunzip -d mydoc.gz

Answer – – A, C and D
Description – All three methods can be used to ungzip the file. The tar command does support gzip, but is used only when uncompressing a tar file.

382. To activate all swap partitions on the system you would use the _______ command (with options).

Answer – – swapon -a.
Description – The swapon -a command enables all swap partitions in the /etc/fstab file.

383. Which command displays the output of the utmp file?

A. what
B. who
C. last
D. when

Answer – – C
Description – The last command shows the utmp file by default, and the who command uses the wtmp file. The other two commands are invalid.

384. The _______ tool is used to control the Apache httpd service.

A. apached
B. httpdctl
C. htmgr
D. apachectl

Answer – – D
Description – The Apache package includes the apachectl tool to manage the httpd daemon. The other Answers are invalid.

385. Which command displays queue information for all local printers?

A. lpq -a
B. lpc -a
C. printq
D. lpq -v

Answer – – A
Description – The lpq tool is used to manage and view the print queue, while lpc is used to manage the printing system. The lpq –a command will display information for all local printers. The printq command is invalid.

386. Which disk partitioning tool provides a GUI?

A. fdisk
B. cfdisk
C. Disk Druid
D. gnodisk

Answer – – C
Description – Disk Druid is a GUI tool supplied by Red Hat. Answers A and B provide text interfaces. Answer D is invalid.

387. The ________ command shows all loaded kernel modules.

Answer – – lshmod.
Description – The lsmod command displays all loaded modules.

388. Which command in vi searches for the text Linux?

A. ESC, s, Linux
B. ESC, f, Linux
C. \Linux
D. /Linux

Answer – – D
Description – The forward slash tells vi to search the file for the given expression. The s command is used for substitution, while the f command searches for a single character in the current line. Answer C is invalid.

389. Which command must be run when a new mail alias is added?

A. newalias
B. newaliases
C. genaliases
D. kill -1 `cat /var/run/`

Answer – – B
Description – Any time an alias is added, the newaliases command needs to be run. Answers A and C are invalid. Restarting the sendmail process will not activate the new aliases.

390. You want to make the directory /share available via NFS. All users on your local network should be allowed to read and write files. Which of the following is correct, assuming that your local network is and your machine is part of the DNS domain

A. /local
B. /local*(rw)
C. /local *.org(rw)
D. /local

Answer – – A
Description – Choice B is invalid due to the subnet mask. Choice C allows anyone from a .org domain to have access. The ALL wildcard is invalid as well.

For Linux MCQ 391 – 420 | Main Linux MCQ Page

Have something to say about this article? Comment below or share it with us on Facebook or Twitter.

Step by step hacking tutorials about wireless cracking, kali linux, metasploit, ethical hacking, seo tips and tricks, malware analysis and scanning.



Subscribe to Our Newsletter and Get Instant Delivered to Your Email Inbox.

We respect your privacy and take protecting it seriously.

Leave a Reply

Your email address will not be published. Required fields are marked *

14 − 9 =