Linux – Multiple Choice Questions – MCQ – 331 to 360 Questions with Explanation

331. Which of the following tools are used when creating a new partition for data storage on a Linux system?

A. fdisk
B. format
C. mkfs
D. mount

Answer – – A, C and D
Description – When creating a new partition for use, the fdisk utility is used to create the partition, the mkfs utility is used to format the partition, and the mount utility is used to mount the file system for use.

332. The __________ utility provides a summary of disk space used in the pwd.

Answer – – du
Description – The du utility is used to display directory space usage information.

333. Which command is used to edit user quotas?

A. quota
B. quotaon
C. edquota
D. vi

Answer – – C
Description – The quota command is used to view user quotas. The quotaon command is used to enable quotas. The edquota command is used to edit disk quotas. The vi editor is started by the edquota command when editing quotas.

334. The umask of 002 would produce what default file permissions?

A. -rwxrwxrw-
B. -rw-rw-r–
C. ———x
D. -rwxrwxr-x

Answer – – D
Description – The umask of 002 would be used to filter the write permission for other users.

335. What access rights are required for the /etc/shadow file?

A. -r——–
B. -rw-rw-r–
C. -r–r—–
D. -rwxr–r–

Answer – – A
Description – The /etc/shadow file must be readable by only the root user.

336. Which command will immediately shut down a computer running Linux?

A. shutdown
B. telinit 6
C. shutdown now
D. telinit 0

Answer – – D
Description – The shutdown command, when used alone, will switch to single-user mode. The telinit command can be used to change runlevels, with level 6 used for rebooting and level 0 used to halt or shut down the system.

337. A new user (Debbie) needs access to the companies Linux system, what must be done so that she can access the system with the userid debbie? (Select all that apply.)

A. useradd debbie
B. group debbie
C. shadow debbie
D. passwd debbie

Answer – – A and D
Description – The useradd command is used to create new user accounts while the passwd command is used to set the user’s password.

338. Which command would give the owner and group of myfile the permissions of read and execute while all others have read access?

A. chmod 003 myfile
B. chmod 554 myfile
C. chmod 331 myfile
D. chmod 662 myfile

Answer – – B
Description – The permissions of read and execute have a numeric value of 5 while the read permission has a value of 4.

339. Which command would be used to view a description of the tar utility including the options available for use?

A. more tar
B. grep tar
C. man tar
D. help tar

Answer – – C
Description – The more utility is used to view a file one page at a time. The grep utility is used to search a file. The man utility is used to present manual pages that contain information about commands. The help utility displays information only for built-in commands.

340. _____________ is the location of files that are copied to each user’s home directory.

Answer – – /etc/skel.
Description – Files that are to be copied to each user’s home directory should be placed in the /etc/skel directory.

341. The PS1 environment variable is used to define which of the following?

A. command path
B. home directory
C. shell prompt
D. signature file

Answer – – C
Description – The shell prompt is configured with the PS1 environment variable. The PATH variable is used for the command path while the home directory is contained in the HOME variable.

342. Which of the following would change the user’s pwd to their home directory regardless of their current pwd? (Select all that apply.)

A. cd
B. cd ..
C. cd~
D. cd $HOME

Answer – – A, C and D
Description – The cd command, when used alone, changes the user’s pwd to their home directory. The $HOME variable and the ~ also can be used to represent the user’s home directory. The cd .. command is used to move up one directory in the directory tree.

343. Which of the following directories is used to store system utilities used by the superuser?

A. /etc
B. /root
C. /sbin
D. /usr/local

Answer – – C
Description – The /etc directory contains many of the configuration files for the system. The /root directory is the home directory for the root user. The /sbin directory contains utilities used by the superuser. The /usr/local directory is used to store software that isn’t part of the operating system.

344. Where are the user shells assigned?

A. /etc/skel
B. /etc/passwd
C. /etc/profile
D. LILO

Answer – – B
Description – The /etc/passwd file is used to store shell script assignments along with home directory assignments. The /etc/skel directory contains the files to be copied to each user’s home directory. The /etc/profile file contains global user settings. The LILO boot loader is used to configure booting options.

345. You have recently installed a new disk drive in your Linux system. You wish to store a directory containing many data files used within your company on the new disk drive. Which of the following can be used so the change is invisible to users of the system?

A. cp
B. mv
C. hard links
D. soft links

Answer – – D
Description – The cp and mv commands can be used to relocate the files. Hard links cannot span file systems. Using soft links, you can have the files appear to be stored on one file system while actually existing on another.

346. Which command and options are used to delete a user’s account and home directory?

A. userdel -r
B. usermod -f
C. passwd -e
D. usermod -e

Answer – – A
Description – The userdel -r command is used to remove a user’s home directory as well as their account. The usermod command can be used to disable a user’s account. The passwd utility is used to change a user’s password.

347. The ____________ utility is used to display files in hexadecimal format.

Answer – – od
Description – The od utility allows files to be viewed in octal and hexadecimal formats.

348. What command can be used to locate specific text within a file?

A. grep
B. locate
C. find
D. where

Answer – – A
Description – The grep utility is used to search a file for the specified string. The locate command searches the slocate database for specified files. The find command searches directories for the specified files. The where command is invalid.

349. Which of the following can be used to suspend a process running in the foreground?

A. &
B. fg
C. bg
D. Ctrl+Z

Answer – – D
Description – The & character is used to background a process when it is run. The fg
command is used to bring a process to the foreground. The bg command is used to background a suspended process. The Ctrl+Z sequence can be used to suspend a foreground process.

350. Where might you find instructions on installing and configuring a Winmodem on a Linux system?

A. man pages
B. HOWTOs
C. /usr/doc
D. dmesg

Answer – – B
Description – Man pages can be used to discover more information on commands and utilities. The HOWTOs contain information on configuring specific software and hardware. The /usr/doc directory contains information on installed applications. The dmesg command is used to display system messages.

351. Which of the following would be used to run a script called mozilla_update as a background process?

A. bg mozilla_update
B. mozilla_update&
C. `mozilla_process`
D. mozilla_process -bg

Answer – – B
Description – The & character is used when running a process to specify that it runs in the background.

352. Which environment variable would be used to specify the location of files that you wish to run without specifying an absolute path?

A. HOME
B. PS1
C. PATH
D. TERM

Answer – – C
Description – The HOME variable stores the user’s home directory. The PS1 variable stores the command prompt settings. The PATH variable contains the paths to search when running commands. The TERM variable stores the terminal setting.

353. The _____________ command is used to change ownership of a file.

Answer – – chown
Description – Ownership of files and directories is changed using the chown command.

354. When booting your system you notice that your sound module failed to load; however, the error message scrolled by too quickly. What command can you use to view the errors?

A. dmesg
B. messages
C. errors
D. lilo

Answer – – A
Description – The dmesg command is used to view system messages. Neither messages nor errors is a valid command. The lilo command is used when updating boot loader options using the /etc/lilo.conf file.

355. What command is used to create a new archived file using compression?

A. gzip -t
B. tar -cfz
C. compress -tf
D. bzip2 -tbz

Answer – – B
Description – Only the tar utility is capable of creating an archive while compressing the file. The gzip, compress, and bzip2 utilities are used to compress and uncompress files.

356. Which command is used to view processes running in the background?

A. dmesg
B. ls
C. bg
D. jobs

Answer – – D
Description – The dmesg command is used to view system messages. The ls command is used to view directory contents. The bg command is used to run a process in the background. The jobs command is used to view jobs running in the background.

357. Which utility is used to view the beginning of a file?

A. tac
B. cat
C. head
D. top

Answer – – C
Description – The tac utility displays files in reverse. The cat utility is used to display file contents. The head utility is used to view the beginning of a file. The top utility is used to view real-time information on system processes.

358. Which type of quota limit prevents a user from creating new files?

A. stop limit
B. soft limit
C. hard limit
D. max limit

Answer – – C
Description – Stop limits and max limits are invalid. Soft limits can be exceeded for a period of time, while hard limits prevent a user from creating new files.

359. Which runlevel is used for administrative tasks performed locally, disallowing network connections to the system?

A. 0
B. 1
C. 3
D. 6

Answer – – B
Description – Runlevel 0 is used to halt the system; level 1 is used to enter single-user mode; level 3 can vary according to the distribution; and level 6 is used to reboot the system.

360. User quotas are maintained in which file?

A. /etc/fstab
B. /etc/passwd
C. /quota.user
D. /lilo

Answer – – C
Description – The /etc/fstab file contains file system information. The /etc/passwd file contains information on user accounts. The /quota.user file contains quota information for users. The /lilo file is invalid.

For Linux MCQ 361 – 390 | Main Linux MCQ Page

You may also like:

Sarcastic Writer

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

Related Posts