Hardest Linux Exam Quiz!

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 Cmdpike
C
Cmdpike
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,123
| Attempts: 1,140
SettingsSettings
Please wait...
  • 1/90 Questions

    To display the last 10 lines of the text file afile.txt, you would type tail afile.txt

    • True
    • False
Please wait...
About This Quiz

The 'Hardest Linux Exam Quiz!' tests advanced knowledge of Linux commands and system administration. It covers CPU, network interfaces, DNS configurations, and disk partitioning, aiming to enhance practical Linux skills.

Hardest Linux Exam Quiz! - Quiz

Quiz Preview

  • 2. 

    Pressing the up arrow key in Bash reveals commands you’ve recently typed.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    Pressing the up arrow key in Bash allows users to access previously typed commands. This feature is useful as it saves time and effort by eliminating the need to retype long or complex commands. It also helps in avoiding typographical errors. By pressing the up arrow key, users can cycle through their command history and retrieve the desired command. This functionality is a convenient feature of the Bash shell.

    Rate this question:

  • 3. 

    Which of the following basic commands will change the directory or take the user back to /home?

    • Rm

    • Cp

    • Cd

    • Head

    • Tail

    Correct Answer
    A. Cd
    Explanation
    The correct answer is "cd" because it is the basic command used to change the current directory in a command line interface. By typing "cd /home", the user will be taken back to the /home directory.

    Rate this question:

  • 4. 

    Which Linux command provides the information by displaying the names of files in a directory?

    • Mv

    • Cp

    • Ln

    • Mkdir

    • Ls

    Correct Answer
    A. Ls
    Explanation
    The correct answer is "ls". The "ls" command is used in Linux to list the files and directories in a directory. It displays the names of the files in the specified directory, providing information about the contents of the directory.

    Rate this question:

  • 5. 

    Which of the following commands displays the name of the directory in which you're working?

    • Wc

    • Cat

    • Echo

    • Cd

    • Pwd

    Correct Answer
    A. Pwd
    Explanation
    The pwd command does as the question specifies, so option E is correct. The wc command counts lines, words, and characters in a text file, so option A is incorrect. The cat command concatenates multiple files or displays a file on the screen, so option B is incorrect. The echo command displays whatever text you give it, or the contents of a variable you give it, so option C is incorrect. The cd command changes the current working directory but does not display its name, so option D is incorrect.

    Rate this question:

  • 6. 

    To view all your recent commands in the command history, type in the command __________.

    Correct Answer
    history
    Explanation
    To view all your recent commands in the command history, you need to type in the command "history". This command will display a list of all the commands that you have executed recently, allowing you to quickly access and review your past actions.

    Rate this question:

  • 7. 

    The files afile.txt and AFile.TXT can both exist on a Linux filesystem because Linux treats filenames in a _____-sensitive way.

    Correct Answer
    case
    Explanation
    Linux treats filenames in a case-sensitive way, which means that it differentiates between uppercase and lowercase letters in filenames. Therefore, both "afile.txt" and "AFile.TXT" can coexist on a Linux filesystem because they have different cases.

    Rate this question:

  • 8. 

    Partitioning a disk can enable you to install multiple OSs on one computer.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    Partitioning a disk allows you to divide it into separate sections or partitions. Each partition can be formatted and used to install a different operating system. This enables you to have multiple operating systems on one computer, allowing you to switch between them as needed. Therefore, the statement is true.

    Rate this question:

  • 9. 

    Which basic command will create a symbolic link (shortcut) to a file?

    • Cp

    • Touch

    • Echo

    • Ln

    • Cat

    Correct Answer
    A. Ln
    Explanation
    The ln command is used to create symbolic links (shortcuts) to files. It allows you to create a new file that points to an existing file, providing a convenient way to access the original file from a different location.

    Rate this question:

  • 10. 

    Which Linux directory holds the system configuration files?

    • /etc

    • /bin

    • /lib

    • /usr

    • /home

    Correct Answer
    A. /etc
    Explanation
    The correct answer is /etc. The /etc directory in Linux holds the system configuration files. These files contain settings and parameters that determine how the operating system and various applications function. It is a central location for storing and managing important configuration files for the system.

    Rate this question:

  • 11. 

    You type touch afile.txt in a directory that contains no files. What will be the effect?

    • The afile.txt file from your home directory will be copied to the current directory.

    • The afile.txt file in your home directory will have its time stamps updated.

    • Nothing; the command will return without doing anything.

    • A new empty file called afile.txt will be created in the current directory.

    • The touch command will return a file not found error.

    Correct Answer
    A. A new empty file called afile.txt will be created in the current directory.
    Explanation
    When you type "touch afile.txt" in a directory that contains no files, the effect will be that a new empty file called "afile.txt" will be created in the current directory. The "touch" command is used to update the access and modification timestamps of a file, but if the file does not exist, it will create a new empty file with the specified name.

    Rate this question:

  • 12. 

    You can delete any file on the computer by using rm as an ordinary user

    • True

    • False

    Correct Answer
    A. False
    Explanation
    Because of Linux’s security features, you can only delete files in directories to which you have write access. As an ordinary user, you should not have write access to most of the system directories, so rm won’t allow you to remove most system files.

    Rate this question:

  • 13. 

    Which of the following commands will print lines from the file world.txt that contain matches to changes and changed?

    • Find change[&c.circ;ds] world.txt

    • Cat world.txt changes changed

    • Find "change'd|s'" world.txt

    • Tar change[d-s] world.txt

    • Grep change[ds] world.txt

    Correct Answer
    A. Grep change[ds] world.txt
    Explanation
    The grep utility finds matching text within a file and prints those lines. It accepts regular expressions, which means you can place in brackets the two characters that differ in the words for which you're looking. Option A shows the correct syntax for doing this. The tar utility creates or manipulates archive files, and option B's syntax is incorrect for any use of tar, so that option is incorrect. The find utility locates files based on filenames, file sizes, and other surface features. Furthermore, options C and E both present incorrect syntax for find, and so are incorrect. Option D's cat utility displays or concatenates files, so it won't have the desired effect and this option is wrong.

    Rate this question:

  • 14. 

    Which key would you press if you wanted to do a command completion of a longer filename or command?

    • Tab

    • Spacebar

    • Enter

    • Shift

    • Ctrl

    Correct Answer
    A. Tab
    Explanation
    Pressing the Tab key allows for command completion of a longer filename or command. This key is commonly used in command line interfaces to automatically complete the rest of a command or filename based on what has been typed so far. It saves time and effort by reducing the need to type out the entire command or filename manually.

    Rate this question:

  • 15. 

    Which character has the specific purpose of specifying the root directory?

    • |

    • ^

    • /

    • %

    • $

    Correct Answer
    A. /
    Explanation
    The character "/" is commonly used in computer systems to specify the root directory. It is used as a delimiter to separate directories in file paths and indicates the starting point or highest level of the directory hierarchy. In Unix-like systems, the root directory is represented by a single forward slash ("/"). Therefore, the character "/" serves the specific purpose of specifying the root directory.

    Rate this question:

  • 16. 

    Which character that represents the start of a line in a regular expression?

    • %

    • |

    • ^

    • &

    Correct Answer
    A. ^
    Explanation
    The character "^" represents the start of a line in a regular expression. It is used to match the beginning of a line or string. When "^" is placed at the beginning of a regular expression pattern, it ensures that the pattern is only matched if it occurs at the start of a line. Therefore, this character is the correct answer to the question.

    Rate this question:

  • 17. 

    Where do most log files reside on a Linux computer?

    • /home/logging

    • /usr/log

    • /etc/logging

    • /var/log

    • /log/usr

    Correct Answer
    A. /var/log
    Explanation
    Most log files on a Linux computer are typically stored in the /var/log directory. This directory is commonly used to store system logs, application logs, and other log files generated by various processes running on the system. The /home/logging, /usr/log, /etc/logging, and /log/usr directories mentioned in the other options are not standard locations for log files on a Linux system.

    Rate this question:

  • 18. 

    Pressing the M key in top causes the display to change to sort processes by memory use

    • True

    • False

    Correct Answer
    A. True
    Explanation
    Pressing the M key in top causes the display to change to sort processes by memory use. This means that when the user presses the M key while using the "top" command, the display will be updated to show the processes sorted based on their memory usage. This allows the user to easily identify which processes are consuming the most memory on the system.

    Rate this question:

  • 19. 

    What does the permission string -rwxrwx--- mean?

    • The file’s owner may read, write, and execute the file, but nobody else may access it.

    • The file is a directory. The directory’s owner and members of its group may read, write, and search it, but other users have no access to it.

    • The file’s owner and members of its group may both read, write, and execute the file, but other users have no access to it.

    • All users of the computer may read, write, and execute the file.  

    • The file is a directory. All users of the computer may read, write, and search the directory.

    Correct Answer
    A. The file’s owner and members of its group may both read, write, and execute the file, but other users have no access to it.
    Explanation
    Option C correctly summarizes the meaning of the specified permission string. The description in option A would be represented by -rwx------, which is not the string shown in the question. Option B would be correct if the string began with d, indicating a directory; but the leading - indicates a data file rather than a directory. Option D’s description would require rwx in the last three characters of the permission string; but the --- indicates no world access. Option E combines the directory error of option B with the world-access error of option D and so is incorrect.

    Rate this question:

  • 20. 

    To allow the man pages to be viewed a page at a time, which pager program is used for displaying man pages?

    • Apropos

    • Grep

    • Locate

    • Whatis

    • Less

    Correct Answer
    A. Less
    Explanation
    The pager program used for displaying man pages a page at a time is "less".

    Rate this question:

  • 21. 

    It is possible to see a list of all the directory paths in your Linux operating system by typing echo $PATH.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    By typing "echo $PATH" in the Linux operating system, it will display a list of all the directory paths. This command is used to view the directories where the system looks for executable files. Therefore, the statement is true.

    Rate this question:

  • 22. 

    You want to copy the contents of the ~/important directory, including all its subdirectories, to /media/usb. What command can you type to accomplish this goal?

    • Cp ~/important /media/usb

    • Cp -R ~/important /media/usb

    • Cp -u ~/important /media/usb

    • Cp -i ~/important /media/usb

    • Cp -f ~/important /media/usb

    Correct Answer
    A. Cp -R ~/important /media/usb
    Explanation
    To copy an entire directory tree, you must use a recursive copy parameter, such as --recursive, -R, or -r. (An archive copy, as in --archive or -a, will also work.) Of the options shown here, only B includes one of these parameters, so it is correct. Option A lacks any parameters to cp, so it won’t work. Option C’s -u option performs an update copy—it copies files only if the original file is newer than any file of the same name at the target location. Option D’s -i performs an interactive copy, querying the user before overwriting existing files. Option E’s -f option forces cp to overwrite existing files without prompting.

    Rate this question:

  • 23. 

    The main filesystem in Linux is referred to as the _____ and is represented with the / symbol.

    Correct Answer
    root
    Explanation
    In Linux, the main filesystem is referred to as the "root" and is represented with the "/" symbol. The root directory is the top-level directory in the file system hierarchy, serving as the parent directory for all other directories and files. It is denoted by the forward slash symbol ("/") and is the starting point for navigating the file system.

    Rate this question:

  • 24. 

    The tail basic command will output the last _____ lines of a file.

    • 5

    • 10

    • 15

    • 20

    • 25

    Correct Answer
    A. 10
    Explanation
    The tail basic command will output the last 10 lines of a file.

    Rate this question:

  • 25. 

    With most distributions, USB flash drives, and other removable media appear in subdirectories of /media

    • True

    • False

    Correct Answer
    A. True
    Explanation
    Most distributions of operating systems, such as Linux, have a default behavior where USB flash drives and other removable media are automatically mounted and appear in subdirectories of the /media directory. This allows users to easily access and manage the files on these devices. Therefore, the statement "With most distributions, USB flash drives, and other removable media appear in subdirectories of /media" is true.

    Rate this question:

  • 26. 

    Which of the following commands provides a low-level way to install software on a Debian system?

    • Rpm

    • Yum

    • Zypper

    • Urpmi  

    • Dpkg

    Correct Answer
    A. Dpkg
    Explanation
    The dpkg program is the low-level interface to the Debian package system; you can use it to install, uninstall, and otherwise manage packages. Thus, option E is correct. Its equivalent on RPM-based systems is rpm, so option A is incorrect. Options B, C, and D are incorrect because they’re all higher-level interfaces to RPM-based systems.

    Rate this question:

  • 27. 

    What symbol do you place after a command to run the program in the background?

    • &

    • +

    • >

    • |

    • #

    Correct Answer
    A. &
    Explanation
    An ampersand (&), placed after a command typed in Bash, causes the command to run in the background, so option A is correct. The remaining options do not accomplish this task, although option C redirects standard output and option D creates a pipe to the following command on the same line. Option B is completely meaningless, as is option E in this context, although a hash mark (#) does serve as a comment character in Bash scripts.

    Rate this question:

  • 28. 

    Which of the following syntaxes will you use to extract a file using the tar command?

    • Tar -cvf {.tgz-file}

    • Tar -zxvf {.tgz-file}

    • Tar -zvf {.tgz-file}

    • Tar -zwvf {.tgz-file}

    Correct Answer
    A. Tar -zxvf {.tgz-file}
    Explanation
    The correct syntax to extract a file using the tar command is "tar -zxvf {.tgz-file}". The "-z" option is used to specify that the file is compressed with gzip, the "-x" option is used to extract the file, the "-v" option is used to display the progress of the extraction, and the "-f" option is used to specify the name of the tar file.

    Rate this question:

  • 29. 

    Which of the following commands will print lines from the file world.txt that contain matches to changes and changed?

    • Find change[&c.circ;ds] world.txt

    • Cat world.txt changes changed

    • Tar change[d-s] world.txt

    • Find "change'd|s'" world.txt

    •   grep change[ds] world.txt

    Correct Answer
    A.   grep change[ds] world.txt
    Explanation
    The correct answer is "grep change[ds] world.txt". This command uses the "grep" tool to search for lines in the file "world.txt" that contain matches to the patterns "change" followed by either "d" or "s".

    Rate this question:

  • 30. 

    Which of the following options to chown changes the ownership of all the subdirectories of any specified directories, rather than just the files or directories that are explicitly passed to it?

    • -R

    • --tree

    • -recursive

    • -all  

    • -t

    Correct Answer
    A. -R
    Explanation
    The -R or --recursive option does as the question specifies, so option A is correct. The --tree, -all, and -t options are all fictitious, so options B, D, and E are all incorrect. Option C is almost correct, but the correct option includes two dashes, not one. That is, it’s --recursive, not -recursive.

    Rate this question:

  • 31. 

    By default, useradd copies a set of user configuration files from /etc/skel when creating a new user account.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    Default user configuration files give users a head start on configuring their accounts and enable system administrators to set user default options. They’re copied from /etc/skel unless you specify another location with the --skel (-k) option to useradd.

    Rate this question:

  • 32. 

    The gzip, bzip2, and xz programs all perform _____ compression, in which the decompressed data exactly match the original pre-compression data.

    • Lossless

    • Streamlined

    • Encryption

    • Existential

    Correct Answer
    A. Lossless
    Explanation
    The gzip, bzip2, and xz programs all perform lossless compression, in which the decompressed data exactly match the original pre-compression data.

    The gzip, bzip2, and xz programs all perform lossless compression, in which the decompressed data exactly match the original pre-compression data.

    Rate this question:

  • 33. 

    Which of the processes can you use to identify running processes? (choose two)

    • Df

    • Ps

    • Bg

    • Mem

    • Top

    Correct Answer(s)
    A. Ps
    A. Top
    Explanation
    The ps and top programs are text-mode commands to identify running programs, so options B and E are both correct. The df program summarizes disk usage, bg shifts a suspended program into background execution, and mem is a device file, so options A, C, and D are all incorrect.

    Rate this question:

  • 34. 

    Which of the following redirection operators appends a program's standard output to an existing file, without overwriting that file's original contents?

    • 2>

    • &>

    • >

    • >>

    • |

    Correct Answer
    A. >>
    Explanation
    The >> operator appends standard output to a file, so option D is correct. The vertical bar (|) is the pipe character; it ties one program's standard output to another's standard input, so option E is incorrect. The 2> operator redirects standard error, not standard output, and it overwrites the target file. Thus, option A is incorrect. The &> operator redirects both standard output and standard error, and it overwrites the target file, so option B is incorrect. The > operator redirects standard output, but it overwrites the target file, so option C is incorrect.

    Rate this question:

  • 35. 

    Linux supports two types of text-mode output to the screen, which you can send to separate files or display devices.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The two types of output are standard output and standard error.

    Rate this question:

  • 36. 

    What option can you pass to groupadd to have it create a group with a GID number of 1027?

    • --groupnum 1027

    • --gnum 1027

    • --gidnum 1027

    • --group 1027  

    • --gid 1027

    Correct Answer
    A. --gid 1027
    Explanation
    The option --gid 1027 can be passed to groupadd to have it create a group with a GID number of 1027.

    Rate this question:

  • 37. 

    What program can you use to manually bring up a network interface in Linux?

    • Iwlist

    • Route

    • Telnet

    • Ifconfig

    • Traceroute

    Correct Answer
    A. Ifconfig
    Explanation
    The ifconfig program does as the question specifies (among other things), so option D is correct. The iwlist command displays information on Wi-Fi networks but does not bring up a network interface, so option A is incorrect. The route command displays or modifies routing tables but does not bring up a network interface, so option B is incorrect. The telnet command is a remote-access and network diagnostic tool, but it does not bring up a network interface, so option C is incorrect. The traceroute command produces network diagnostic information, but it does not bring up a network interface, so option E is incorrect.

    Rate this question:

  • 38. 

    The mv command is used to both move and _____ files and directories.

    Correct Answer
    rename
    Explanation
    The mv command is used to both move and rename files and directories.

    Rate this question:

  • 39. 

    Which of the following actions is performed when a file is uncompressed?

    • Execute

    • Extract

    • Archive  

    • Remove

    Correct Answer
    A. Extract
    Explanation
    When a file is uncompressed, the action that is performed is extracting the contents of the compressed file. This involves decompressing the file and restoring it to its original form, allowing access to the individual files and folders within the compressed file.

    Rate this question:

  • 40. 

    Users should be logged in when you change their UID numbers with usermod

    • True

    • False

    Correct Answer
    A. False
    Explanation
    If a user is logged in when you change the user’s UID number, problems can ensue because the login session will continue to use the old UID number. Thus, users should be logged out before you attempt to change their UID numbers.

    Rate this question:

  • 41. 

    Your network’s hardware interface is called eth0. You want to bring up this interface via DHCP, so you type dhclient eth0 as root.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The given statement is true because typing "dhclient eth0" as root is the correct command to bring up the network's hardware interface, eth0, via DHCP. The "dhclient" command is used to obtain an IP address from a DHCP server, and specifying "eth0" tells the command to apply DHCP to that specific network interface.

    Rate this question:

  • 42. 

    To run a GUI program in Linux, you must launch it from a desktop environment’s menus.

    • True

    • False

    Correct Answer
    A. False
    Explanation
    This statement is false because it is not necessary to launch a GUI program from a desktop environment's menus in Linux. GUI programs can also be launched from the command line by typing the program's name and pressing enter. Additionally, some Linux distributions allow users to create shortcuts or launchers on the desktop or taskbar to directly run GUI programs without accessing the menus.

    Rate this question:

  • 43. 

    You can use the ____ command to count the characters, words, and lines in a text file.

    Correct Answer
    wc
    Explanation
    The "wc" command can be used to count the characters, words, and lines in a text file. This command is commonly used in Unix and Unix-like operating systems. By executing the "wc" command followed by the file name, it will provide the count of characters, words, and lines present in the specified text file.

    Rate this question:

  • 44. 

    Which of the following programs produces a summary of the memory status of your computer, including the total memory available, the amount used, and the amount that’s unused?

    • Free

    • Mem

    • Mf

    • Avail  

    • Df

    Correct Answer
    A. Free
    Explanation
    The free command produces the information specified, so option A is correct. Options B, C, and D are all fictitious program names, at least on Linux. The Linux df command (option E) produces a summary of disk space available and used, not memory, so it’s incorrect.

    Rate this question:

  • 45. 

    The find command enables you to locate files based on their sizes.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The find command is a powerful tool that allows users to search for files based on various criteria, including their sizes. By using the appropriate options and arguments, users can specify a size range or a specific size to search for files that match the given criteria. Therefore, the statement that the find command enables you to locate files based on their sizes is true.

    Rate this question:

  • 46. 

    GUI account management tools provide more options than their text-mode counterparts.

    • True

    • False

    Correct Answer
    A. False
    Explanation
    GUI account management tools do not necessarily provide more options than their text-mode counterparts. The statement is incorrect because both GUI and text-mode account management tools can offer a range of options, and the number of options available is not determined solely by the interface. The functionality and features of the tools are determined by the software itself, not the way it is presented to the user. Therefore, the correct answer is False.

    Rate this question:

  • 47. 

    You’re writing a script that should accept two arguments, a username and a year, specified in that order on the command line. What variable would you use to access the year?

    • $1

    • $year

    • $annum

    • $2  

    • $B

    Correct Answer
    A. $2  
    Explanation
    Command-line arguments are accessed within a script as numbered variables, with $0 being the program name, $1 being the first argument (the username in this example), $2 being the second argument (the year in this example), and so on. Thus, option D is correct. Option A’s $1 would access the username and so is incorrect. Options B, C, and E are all valid Bash variable names, but none will refer automatically to the command-line arguments and so are incorrect.

    Rate this question:

  • 48. 

    Which of the following pieces of information on user accounts is not normally stored in the /etc/passwd file on modern Linux distributions?

    • The account’s default shell

    • The account’s default GID number

    • The account’s UID number

    • The account’s username  

    • The account’s password

    Correct Answer
    A. The account’s password
    Explanation
    Although /etc/passwd includes a field for the password, that field normally contains an x value, meaning that the encrypted password is stored in /etc/shadow. Thus, option E is correct. The account’s default shell, default GID number, UID number, and username all appear in /etc/passwd, so options A, B, C, and D are all incorrect.

    Rate this question:

  • 49. 

    Which of the following commands is used to extract a compressed file?

    • Gzip

    • Bzip2

    • Ext

    • Gunzip

    Correct Answer
    A. Gunzip
    Explanation
    The command "gunzip" is used to extract a compressed file.

    Rate this question:

Quiz Review Timeline (Updated): Aug 10, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Aug 10, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 09, 2020
    Quiz Created by
    Cmdpike
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.