Linux Commands Multiple Choice 2

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 Mariiikar
M
Mariiikar
Community Contributor
Quizzes Created: 2 | Total Attempts: 7,288
| Attempts: 503 | Questions: 69
Please wait...
Question 1 / 69
0 %
0/100
Score 0/100
1. What basic command is used to create hard disk partitions?

Explanation

The basic command used to create hard disk partitions is fdisk. Fdisk is a command-line utility that allows users to create, delete, and manipulate disk partitions on a hard disk. It is commonly used in Linux and Unix systems to manage the partitioning of hard drives. With fdisk, users can create new partitions, specify their size and location, and set the partition type. It is a powerful tool for managing the storage space on a hard disk and organizing data effectively.

Submit
Please wait...
About This Quiz
Linux Commands Multiple Choice 2 - Quiz

This is part two of Linux commands multiple choice questions. These quizes should get you up to scratch for any Linux certificate, college module, etc. Just repeat the... see morequiz over and over until you get 90% + and you will surely be ahead of the rest at exam time. see less

2. What command (include applicable options) is used to initiate a change to runlevel 5?

Explanation

The command "init 5" is used to initiate a change to runlevel 5. This command is commonly used in Unix-like operating systems to switch to a multi-user graphical mode. The alternative command "telinit 5" can also be used, as it is a symbolic link to the same file as "init 5". Both commands will achieve the same result of transitioning to runlevel 5.

Submit
3. State the syntax to direct the standard output of cmd1 directly into the standard input of cmd2.

Explanation

The correct answer is "cmd1 | cmd2" because the pipe symbol "|" is used to redirect the standard output of cmd1 to the standard input of cmd2. This allows the output of cmd1 to be used as the input for cmd2, enabling the two commands to be connected in a pipeline.

Submit
4. What command and single required option creates a symbolic link in a Linux filesystem?

Explanation

The command "ln -s" creates a symbolic link in a Linux filesystem. This command is used to create a shortcut or reference to a file or directory. The "-s" option specifies that the link being created is a symbolic link.

Submit
5. What are the two interrupts usually associated with a PC's onboard serial interface?

Explanation

The two interrupts usually associated with a PC's onboard serial interface are interrupt 3 and interrupt 4. These interrupts are used to handle the communication between the serial port and the computer's CPU. Interrupt 3 is typically used for the first serial port (COM1), while interrupt 4 is used for the second serial port (COM2). These interrupts allow the CPU to be notified when data is received or when the serial port is ready to send data, enabling efficient and reliable serial communication.

Submit
6. What ext2 filesystem attribute allows a process to take on the ownership of the executable file's owner?

Explanation

SUID (Set User ID) is an ext2 filesystem attribute that allows a process to take on the ownership of the executable file's owner. When SUID is set on an executable file, the process that runs the file will have the same privileges as the owner of the file, regardless of the user who executed the file. This attribute is commonly used for programs that require elevated privileges to perform certain tasks, allowing regular users to execute them without compromising system security.

Submit
7. What is appended to the beginning of a command line in order to modify the execution priority of the resulting process?

Explanation

The command "nice" is appended to the beginning of a command line in order to modify the execution priority of the resulting process. By using the "nice" command, the user can adjust the priority level of a process, giving it a higher or lower priority compared to other processes running on the system. This allows the user to control the allocation of system resources and prioritize certain tasks over others.

Submit
8. What two commands display the status of processes on a Linux system?

Explanation

b. Both ps and top yield process status. None of the other listed commands are related to processes.

Submit
9. A process with PID 4077 is misbehaving on your system. As superuser, you enter the following command:# kill 4077

However, nothing changes as a result. What can you do to terminate the process? Select one.

Explanation

a. kill -9 is drastic but necessary for processes unable to respond to other signals.

Submit
10. Which one of the following statements correctly describes the > and >> symbols in the context of the bash shell?

Explanation

b. The > character opens and writes to a new file, while >> appends to an existing file, unless that file doesn't exist, in which case it is opened first.

Submit
11. How are the cat and tac commands related? Select one.

Explanation

a. cat concatenates files, and as a subset, will list one or more files to standard output. tac lists files in reverse order.

Submit
12. Which of the following is a reasonable size for a swap partition for a Linux workstation with 128 MB RAM? Select one.

Explanation

A reasonable size for a swap partition for a Linux workstation with 128 MB RAM would be 100 MB. The swap partition is used as virtual memory when the physical RAM is full, allowing the system to continue running smoothly. The size of the swap partition should generally be equal to or slightly larger than the amount of RAM in the system. In this case, 100 MB is a reasonable size considering the 128 MB RAM.

Submit
13. What does the & character do when placed at the end of a command?

Explanation

e. Using the & character puts a program in the background.

Submit
14. Which one of the following commands is equivalent to the following command for user jdoe whose home directory is /home/jdoe?# chmod 754 ~/file1

Explanation

a. User mode 7 is the same as u=rwx, group mode 5 is the same as g=rx, and other mode 4 is the same as o=r. The ~/ syntax implies the user's home directory.

Submit
15. Consider the following line of console output, excerpted from among other lines of output. Which one of the commands produced it?
/dev/hda8   1.9G 559M 1.2G 30% /home

Explanation

e. A filesystem without free inodes cannot create new objects until existing objects are removed.

Submit
16. Which one of the following commands could be used to change all uppercase characters to lowercase in the middle of a pipe?

Explanation

d. The tr program translates characters from one group into another, including case.

Submit
17. Which one of the following commands copies files with the .txt extension from /dir1 into /dir2, while preserving file attributes such as dates?

Explanation

d. The -p, or preserve, option is required to retain dates.

Submit
18. What will happen when rpm is launched as follows?
rpm -Uvh file

Explanation

c. Provided that file is an RPM file, the -U indicates that an upgrade should occur. -h turns on hash marks.

Submit
19. Which one of the following commands verbosely extracts files from a tar archive on a magnetic tape device?

Explanation

c. tar should be used with the extraction option x and a tape device, such as SCSI tape /dev/st0.

Submit
20. Which command will display the last lines of the text file file1?

Explanation

d. The tail command is used for checking the last lines of a text file. By default, it displays 10 lines.

Submit
21. What does the "sticky bit" do? Select one.

Explanation

c. The sticky bit in the mode prevents deletion by non-owners, but root can still delete the file.

Submit
22. Which one of the following commands would be best suited to mount a CD-ROM containing a Linux distribution, without depending on any configuration files?

Explanation

c. CD-ROMs use the iso9660 filesystem, which is the default for mount, but also indicated using -t. Without the assistance of an entry in /etc/fstab, both the mount device (/dev/cdrom) and the mount point (/mnt/cdrom) must be provided.

Submit
23. How are changes to the system BIOS made? Select one.

Explanation

d. Linux has no control over the BIOS settings.

Submit
24. What is the PID of init? Select one.

Explanation

b. init, the grandfather of all processes, always has PID 1.

Submit
25. Monica consults the /etc/passwd file expecting to find encrypted passwords for all of the users on her system. She sees the following:
jdoe:x:500:500::/home/jdoe:/bin/bash
bsmith:x:501:501::/home/bsmith:/bin/tcsh

Which of the following is true? Select one.

Explanation

d. The shadow password system has been implemented, placing all passwords in /etc/shadow as denoted by the x following the username.

Submit
26. In response to the df command, the system reports a Use% of 98% for the filesystem mounted on /home. Which one of the following best describes the significance of this information?

Explanation

c. df reports disk information, including a percentage of the filesystems used. Answer a is incorrect because /home may not be the only partition on the physical disk.

Submit
27. Which of the following commands cannot be used to exit from vi when in command mode? Select one.

Explanation

e. :bye is not a valid command in vi.

Submit
28. With regard to the use of regular expressions to match text in a file, describe a metacharacter. Select one.

Explanation

b. A metacharacter is a special character that is used to modify and control the interpretation of literals. File globbing is generally considered distinct but very similar to the use of regular expressions.

Submit
29. Which one of the following file globs matches "Linux" and "linux," but not "linux.com" and not "TurboLinux"?

Explanation

d. The [Ll] matches both letters.

Submit
30. What does the device file /dev/hdb6 represent?

Explanation

e. IDE disk drives are referred to as /dev/hdx, where x is a, b, c, or d. Partitions are numbered from 1 through 4 for primary and extended partitions and 5 through 16 for logical partitions.

Submit
31. How many IDE devices can be installed and simultaneously used in a typical Intel-based system? Select one.

Explanation

d. PCs usually have two IDE interfaces, each capable of handling two devices.

Submit
32. How can you query the RPM database for a list of all installed RPM packages? Select one.

Explanation

b. The query mode is required, which implies -q. The -a option in query mode yields all packages.

Submit
33. .Which one of the following answers creates an environment variable VAR1, present in the environment of a bash child process?

Explanation

a. The variable must be set and exported. The semicolon separates the two commands.

Submit
34. Which one of the following outcomes results from the following command?# chmod g+s /home/software

Explanation

c. The g indicates that we're operating on the group privilege, and the +s indicates that we should add the "set id" bit, which means that the SGID property will be applied.

Submit
35. Which one of the following utilities outputs a text file with line numbers along the left margin?

Explanation

d. The nl command numbers lines.

Submit
36. When using xdm, which of the following files can be used to start a window manager? Select one.

Explanation

d. Xsession is the system-wide default application startup file.

Submit
37. Which one of the following key sequences is used to put a noninteractive text-mode program that is attached to the terminal into the background to allow it to continue processing?

Explanation

e. Ctrl-Z stops the job and gives control back to the terminal. bg places the job into the background and restarts it.

Submit
38. What is contained in directory /sbin? Select the single best answer.

Explanation

c. While answers b and d are technically correct, answer c best describes /sbin.

Submit
39. Which of the following is the text file that contains directories where the dynamic linker should look for libraries? Select one.

Explanation

a. ld.so.conf is the text file in which you add library directories. ld.so.cache is the binary index resulting from ldconfig.

Submit
40. Which one of the following would be a consequence of a filesystem running out of inodes?

Explanation

c. This is an example line from the output of df -h, the "human-readable" mode of df.

Submit
41. How do you use dpkg to verify the status of an installed package mypkg? Select one.

Explanation

a. The appropriate option is either -s or --status.

Submit
42. Of the following directories, which one is the most important to back up on a routine basis?

Explanation

e. /var and /tmp are mainly transient, /usr is typically static (and should be easy to reinstall from the original OS media), /root is simply a home directory for root, but /etc contains system configuration information that frequently changes.

Submit
43. An ext2 filesystem is configured with user quotas enabled. The soft limit is set at 100 MB per user, the hard limit is set at 110 MB per user, and the grace period is seven days. User bsmith already owns 90 MB of the data stored on the filesystem. What happens when bsmith writes a new file of size 30 MB? Select one.

Explanation

b. The write will continue until the hard limit of 110 MB is reached, after which the write fails and data is lost.

Submit
44. With a umask of 027, how is the initial mode set for a newly created file?

Explanation

b. By default, files do not have the execute privilege, which rules out all responses containing odd numbers in the mode. They also do not by default have the sticky bit set, which eliminates response e. Response b is the result of masking initial bits 666 with umask 027, leaving 640, which is the same as 0640.

Submit
45. Why might an administrator use the --force option for rpm?

Explanation

An administrator might use the --force option for rpm to forcefully delete installed packages. This option allows the administrator to bypass any warnings or confirmation messages that would normally be displayed when attempting to delete a package. By using this option, the administrator can ensure that the package is deleted without any interruptions or prompts.

Submit
46. What command can display the contents of a binary file in a readable hexadecimal form? Select one.

Explanation

c. The octal dump program, when used with the -t x option, will output in hexadecimal notation.

Submit
47. Which file contains information on the I/O port assignments in use? Select one.

Explanation

The correct answer is /proc/ioports. The /proc/ioports file contains information on the I/O port assignments in use. This file is a virtual file system that provides an interface to kernel data structures, allowing users to access information about various system resources. In the case of I/O port assignments, this file specifically lists the ranges of I/O ports that are currently in use by devices on the system.

Submit
48. Alex is currently working in a directory containing only one file, Afile1. What is displayed after the following commands are entered in bash?
# MYVAR=lsecho $MYVAR "$MYVAR" '$MYVAR' '$MYVAR'

Explanation

d. The first echo argument is unquoted and thus returns its contents, ls. The second is quoted with double quotes, which do not preserve the $, so it too returns ls. The third is quoted with single quotes, which do preserve the $, so it returns the string $MYVAR. The last argument is backquoted, which means that it returns the result of the command stored in $MYVAR. The command is ls, which displays the only file in the directory, Afile1.

Submit
49. Which one of the following is an accurate statement regarding this regular expression?[^1-8A-Za-z]

Explanation

d. Brackets ([ ]) are used to group a character set consisting of numbers 18 and characters A-Z and a-z. The ^ just inside the opening bracket negates the whole string, such that the string matches numbers 0, 9, and symbols.

Submit
50. In the Bash shell, entering !! has the same effect as which one of the following?

Explanation

a. The !! command history expansion executes the previous command. Entering the Ctrl-P keystroke uses the Emacs key-binding bash to move up one line in the history; pressing Enter executes that command.

Submit
51. Carolyn has a text file named guest_list containing 12 lines. She executes the following command. What is the result?# split -4 guest_list gl

Explanation

d. split -n outfile separates a file into multiple output files, each with n lines, and names them outfileaa, outfileab, and so on. Since the original file had 12 lines and Carolyn split it into sets of 4 lines, the result is three files named glaa, glab, and glac, each containing 4 lines.

Submit
52. Your system's FontPath directives include only one entry:
unix/:-1

Which of the following is true? Select one.

Explanation

c. The directive indicates that a font server should listen on its default port.

Submit
53. Which of the following accurately describes the contents of the xdisp:1.0 DISPLAY environment variable? Select one.

Explanation

c. The system, xdisp, will display programs on the second display of its X server.

Submit
54. What is the startx command? Select one.

Explanation

a. startx is included with XFree86 as a suggestion, and customization is encouraged.

Submit
55. Dave has a Linux system with an interrupt conflict caused by his 3c509 network card. Dave's kernel is fully modular. How could Dave instruct the system to use IRQ 11 for his network adapter?

Explanation

c. Since Dave is using a modular kernel, the network driver 3c509.o is a kernel module. LILO can send kernel parameters but not module parameters. These are stored in /etc/conf.modules.

Submit
56. What is XDMCP, and how is it used? Select one.

Explanation

d. X terminals use XDMCP to attach to xdm daemons.

Submit
57. Which one of the following is true about the LILO boot loader?

Explanation

a. LILO can start the Windows NT boot loader and many other operating systems.

Submit
58. What is the correct syntax to remove mypkg entirely from a Debian GNU/Linux system, including configuration files? Select one.

Explanation

e. The --purge option is a variant of -r, remove.

Submit
59. Which of the following statements is true about an X server? Select one.

Explanation

d. A window manager is a client, controlled by the X server. Answers a and b are incorrect because they imply that the X server originates the graphical output. Answers c and e are common misconceptions.

Submit
60. Which is not a valid dpkg installation command? Select one.

Explanation

b. Options -i (install) and -L (list installed files) are incompatible and don't make sense together.

Submit
61. How many target devices can be added to an 8-bit SCSI-2 bus? Select one.

Explanation

b. An 8-bit SCSI bus has three address lines, thus providing 2^3 or 8 addresses. Setting aside one for the controller, there are 7 addresses for devices.

Submit
62. Which of the following directories must be part of the root filesystem? Select two of the following that apply.

Explanation

a and c. /etc, /lib, /bin, /sbin, and /dev must be in the / filesystem.

Submit
63. When partitioning a disk with more than 1024 cylinders, which of the following could affect the system's ability to boot? Select all that apply.

Explanation

a and b. Both the second stage of LILO and the kernel should be kept within the 1024-cylinder boundary.

Submit
64. Alex wants to protect himself from inadvertently overwriting files when copying them with cp. How should he go about this?

Explanation

a or b. cp should be aliased to the interactive mode with the -i option in .bashrc. .bash_profile normally doesn't include aliases, but it will also work.

Submit
65. Which pair of dpkg options are equivalent and what do they do? Select one.

Explanation

The correct answer is -C and --audit; they search for partially installed packages. The -C option is used to search for partially installed packages, while the --audit option is also used to search for partially installed packages. Both options perform the same function of searching for packages that were only partially installed.

Submit
66. How can you obtain a list of files contained in an .rpm file? Select one.

Explanation

d. rpm -qlp queries and lists files in the package.

Submit
67. The following line comes from /etc/fstab Which of the statements is accurate given the contents of this line? Choose two that apply./dev/fd0 /mnt/fd0 vfat noauto,users 0 0

Explanation

b and e. The users option grants nonprivileged users the right to mount and unmount the filesystem. /dev/fd0 is a floppy device.

Submit
68. Which of the following commands can be used to check an ext2 filesystem? Select three that apply.

Explanation

b, c, and d. fsck is a frontend for the programs that actually do the checking. e2fsck and fsck.ext2 are links to the program that checks native Linux ext2 filesystems.

Submit
69. Which of the following commands displays the comments from a bash script? Select all that apply.

Explanation

b and c. find and locate do not search the contents of files. /etc/passwd is not a script.

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 19, 2010
    Quiz Created by
    Mariiikar
Cancel
  • All
    All (69)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What basic command is used to create hard disk partitions?
What command (include applicable options) is used to initiate a change...
State the syntax to direct the standard output of cmd1 ...
What command and single required option creates a symbolic link in a...
What are the two interrupts usually associated with a PC's onboard...
What ext2 filesystem attribute allows a process ...
What is appended to the beginning of a command line in order to modify...
What two commands display the status of processes on a Linux system?
A process with PID 4077 is misbehaving on your system. As superuser,...
Which one of the following statements correctly describes the > and...
How are the cat and tac commands related? Select one.
Which of the following is a reasonable size for a swap partition for a...
What does the & character do when placed at the end of a command?
Which one of the following commands is equivalent to the following...
Consider the following line of console output, excerpted from among...
Which one of the following commands could be used to change all...
Which one of the following commands copies files with the .txt...
What will happen when rpm is launched as follows? rpm -Uvh file
Which one of the following commands verbosely extracts files from a...
Which command will display the last lines of the text file file1?
What does the "sticky bit" do? Select one.
Which one of the following commands would be best suited to mount a...
How are changes to the system BIOS made? Select one.
What is the PID of init? Select one.
Monica consults the /etc/passwd ...
In response to the df command, ...
Which of the following commands cannot be used to exit from vi when in...
With regard to the use of regular expressions to match text in a file,...
Which one of the following file globs matches "Linux" and "linux," but...
What does the device file /dev/hdb6 represent?
How many IDE devices can be installed and simultaneously used in a...
How can you query the RPM database for a list of all installed RPM...
.Which one of the following answers creates an environment variable ...
Which one of the following outcomes results from the following...
Which one of the following utilities outputs a text file with line...
When using xdm, which of the following files can ...
Which one of the following key sequences is used to put a...
What is contained in directory /sbin? Select the single best answer.
Which of the following is the text file that contains directories...
Which one of the following would be a consequence of a filesystem...
How do you use dpkg to verify the status of an ...
Of the following directories, which one is the most important ...
An ext2 filesystem is configured ...
With a umask of 027, how is the initial mode set for a newly created...
Why might an administrator use the --force option for rpm?
What command can display the contents of a binary file in a readable...
Which file contains information on the I/O port assignments in use?...
Alex is currently ...
Which one of the following is an accurate statement regarding this...
In the Bash shell, entering !! has the same effect as which one of the...
Carolyn has a text file named guest_list ...
Your system's FontPath directives include only one ...
Which of the following accurately describes the contents of the...
What is the startx command? Select one.
Dave has a Linux system with an interrupt conflict caused by his 3c509...
What is XDMCP, and how is it used? Select one.
Which one of the following is true about the LILO boot loader?
What is the correct syntax to remove mypkg ...
Which of the following statements is true about an X server? Select...
Which is not a valid dpkg installation command? Select one.
How many target devices can be added to an 8-bit SCSI-2 bus? Select...
Which of the following directories must be part ...
When partitioning a disk with more than 1024 cylinders, which of the...
Alex wants to ...
Which pair of dpkg options are equivalent and ...
How can you obtain a list of files contained in an .rpm file? Select...
The following line comes from /etc/fstab Which of the...
Which of the following commands can be used to check an ext2...
Which of the following commands displays the comments from a bash...
Alert!

Advertisement