Linux Essentials Final Exam (Modules 9 – 16)

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Belac
B
Belac
Community Contributor
Quizzes Created: 1 | Total Attempts: 823
Questions: 40 | Attempts: 828

SettingsSettingsSettings
Linux Essentials Final Exam (Modules 9  16) - Quiz

.


Questions and Answers
  • 1. 

    The number of users logged in is in a variable called USERS. How would you test to see if 5 users are logged in?

    • A.

      Test $USERS = 5

    • B.

      Test $USERS –a 5

    • C.

      Test $USERS,5

    • D.

      Test –f USERS=5

    • E.

      Test $USERS –eq 5

    Correct Answer
    E. Test $USERS –eq 5
    Explanation
    The correct answer is "test $USERS –eq 5". This is the correct way to test if the value of the variable USERS is equal to 5. The "-eq" operator is used to check for equality in shell scripting. Therefore, this command will evaluate to true if the value of USERS is indeed 5, and false otherwise.

    Rate this question:

  • 2. 

    Given the following script: while [ ! –f /tmp/foo ]; do echo –n “.” process_data > /tmp/foo done Which of the following are true? (choose two)

    • A.

      The screen will fill with dots.

    • B.

      /tmp/foo will be removed if it exists

    • C.

      Process_data will never be run

    • D.

      If a file called /tmp/foo exists, process_data won’t be run

    • E.

      Process_data will be called at most once

    Correct Answer(s)
    D. If a file called /tmp/foo exists, process_data won’t be run
    E. Process_data will be called at most once
    Explanation
    The screen will fill with dots because the script contains a while loop that will continue executing the echo command until the file /tmp/foo exists. The echo command is used to print a dot on the screen.

    If a file called /tmp/foo exists, process_data won't be run because the condition in the while loop checks for the existence of the file /tmp/foo using the -f flag. If the file exists, the loop will exit and process_data will not be executed.

    process_data will be called at most once because once the file /tmp/foo is created by the process_data command, the condition in the while loop will evaluate to false and the loop will exit. Therefore, process_data will only be called once.

    /tmp/foo will be removed if it exists is not true because there is no command or statement in the given script that removes the file /tmp/foo.

    Therefore, the correct answers are: If a file called /tmp/foo exists, process_data won’t be run and process_data will be called at most once.

    Rate this question:

  • 3. 

    A conditional that lets you make multiple comparisons with a pattern is called:

    • A.

      Fanout

    • B.

      If

    • C.

      Branch

    • D.

      Case

    Correct Answer
    D. Case
    Explanation
    A conditional that lets you make multiple comparisons with a pattern is called a "case". This is because a case statement allows you to evaluate multiple conditions and execute different blocks of code depending on the value of the variable being evaluated. It is commonly used when there are multiple possible outcomes or conditions that need to be checked against a single variable.

    Rate this question:

  • 4. 

    What is the meaning of $(( $i + 1)) ?

    • A.

      If i is 0, the loop will stop

    • B.

      This will return the value of the first argument to the script

    • C.

      1 will be added to the i variable

    • D.

      This runs the command stored in variable i

    • E.

      This will return the value of the next argument to the script

    Correct Answer
    C. 1 will be added to the i variable
    Explanation
    The correct answer is "1 will be added to the i variable." This is because the expression $(( $i + 1)) is an arithmetic expansion in bash, where the value of i is incremented by 1. The double parentheses $(( )) are used to perform arithmetic operations in bash, and in this case, it adds 1 to the value of i.

    Rate this question:

  • 5. 

    How would you write a test that says “if /tmp/foo is a directory or USERS is greater than 5”?

    • A.

      Test –d /tmp/foo | $USERS > 5

    • B.

      Test /tmp/foo –d –o $USERS -gt 5

    • C.

      Test /tmp/foo || $USERS > 5

    • D.

      Test –d /tmp/foo –o $USERS –gt 5

    • E.

      Test –f /tmp/foo –o $USERS –ge 5

    Correct Answer
    D. Test –d /tmp/foo –o $USERS –gt 5
    Explanation
    The correct answer is "test –d /tmp/foo –o $USERS –gt 5". This answer uses the "test" command with the "-d" flag to check if "/tmp/foo" is a directory. It also uses the "-o" flag to combine this condition with the condition that "$USERS" is greater than 5. This test will return true if either condition is met.

    Rate this question:

  • 6. 

    A division of a hard drive may be referred to as a _______ .

    • A.

      Partition

    • B.

      Label

    • C.

      Slice

    • D.

      Block

    Correct Answer(s)
    A. Partition
    C. Slice
    Explanation
    A division of a hard drive is commonly referred to as a partition or a slice. This is because a hard drive can be divided into separate sections or partitions, each of which can be used to store data independently. These partitions or slices allow for better organization and management of data on the hard drive.

    Rate this question:

  • 7. 

    Which of the following are valid partitioning types? (choose two)

    • A.

      MBR

    • B.

      PC

    • C.

      GPT

    • D.

      BIOS

    Correct Answer(s)
    A. MBR
    C. GPT
    Explanation
    MBR (Master Boot Record) and GPT (GUID Partition Table) are valid partitioning types. MBR is a traditional partitioning scheme used on BIOS-based systems, while GPT is a newer partitioning scheme commonly used on UEFI-based systems. Both MBR and GPT allow for the division of a storage device into multiple partitions, each with its own file system. PC and BIOS, on the other hand, are not valid partitioning types and do not refer to any specific partitioning schemes.

    Rate this question:

  • 8. 

    The fdisk command is a tool used for working with the MBR partitioned disks. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The fdisk command is indeed a tool used for working with the MBR partitioned disks. It allows users to create, delete, and manage partitions on a disk. This command is commonly used in Linux and Unix systems to manage disk partitions. Therefore, the given answer "True" is correct.

    Rate this question:

  • 9. 

    Which of the following is the valid device file name for the first IDE hard drive on the system?

    • A.

      /dev/sda

    • B.

      /dev/hd1

    • C.

      /dev/hda

    • D.

      /dev/ide

    Correct Answer
    C. /dev/hda
    Explanation
    The correct answer is /dev/hda. In Linux systems, device files are used to access hardware devices. The /dev/hda file represents the first IDE hard drive on the system. The "hda" naming convention is commonly used for IDE hard drives, with "hd" indicating a hard drive and "a" representing the first drive. Therefore, /dev/hda is the valid device file name for the first IDE hard drive on the system.

    Rate this question:

  • 10. 

    Which of the following are valid video cable connector types? (choose two)

    • A.

      AMD

    • B.

      DVI

    • C.

      VGA

    • D.

      HDA

    Correct Answer(s)
    B. DVI
    C. VGA
    Explanation
    DVI (Digital Visual Interface) and VGA (Video Graphics Array) are both valid video cable connector types. DVI is a digital video connector commonly used to connect a computer to a monitor or projector. It supports high-quality video signals and can transmit both digital and analog signals. VGA, on the other hand, is an older analog video connector that is still widely used. It is commonly found on older computers and displays and can support lower resolutions compared to DVI. Both DVI and VGA connectors are commonly used in the video industry and are compatible with various devices.

    Rate this question:

  • 11. 

    A command that will continuously update statistics about running processes:

    • A.

      Top

    • B.

      Tail

    • C.

      Bottom

    • D.

      Head

    Correct Answer
    A. Top
    Explanation
    The correct answer is "top" because the "top" command in Linux continuously updates and displays real-time information about running processes, including CPU and memory usage, process IDs, and more. It provides a dynamic view of the system's performance and allows users to monitor and manage processes effectively.

    Rate this question:

  • 12. 

    The following are valid Linux option styles: (choose three)

    • A.

      Traditional Unix with a single dash (-)

    • B.

      BSD Unix without a dash

    • C.

      DOS slash (/)

    • D.

      GNU long options with two dashes (–)

    Correct Answer(s)
    A. Traditional Unix with a single dash (-)
    B. BSD Unix without a dash
    D. GNU long options with two dashes (–)
    Explanation
    The question is asking for the valid Linux option styles. The correct answer is Traditional Unix with a single dash (-), BSD Unix without a dash, and GNU long options with two dashes (–). These are the commonly used option styles in Linux. The Traditional Unix style uses a single dash before the option, BSD Unix style does not use a dash, and GNU long options style uses two dashes before the option. DOS slash style is not a valid Linux option style.

    Rate this question:

  • 13. 

    Which file contains the information passed to the kernel at boot time?

    • A.

      /proc/kargs

    • B.

      /proc/kernel

    • C.

      /proc/kopts

    • D.

      /proc/cmdline

    Correct Answer
    D. /proc/cmdline
    Explanation
    The /proc/cmdline file contains the information passed to the kernel at boot time. This file provides the command line arguments that were used to boot the kernel, including options such as the kernel version, root device, and other parameters. It is a virtual file that can be accessed to view or modify the command line arguments used during the boot process.

    Rate this question:

  • 14. 

    To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it:

    • A.

      /etc/sysctl.conf

    • B.

      /etc/procctl.conf

    • C.

      /etc/procsys.conf

    • D.

      /etc/sysinfo.conf

    Correct Answer
    A. /etc/sysctl.conf
    Explanation
    The correct answer is /etc/sysctl.conf. This file is used to configure kernel parameters and allows entries to be added to make changes permanent for kernel parameter files found under /proc/sys. By adding entries to /etc/sysctl.conf, the changes will persist even after a system reboot.

    Rate this question:

  • 15. 

    To get a list of all packages installed on a system using RPM Package Management you can execute:

    • A.

      Rpm -qa

    • B.

      Rpm -ql

    • C.

      Rpm -qf

    • D.

      Rpm -qi

    Correct Answer
    A. Rpm -qa
    Explanation
    The command "rpm -qa" is used to get a list of all packages installed on a system using RPM Package Management. This command queries the RPM database and returns a list of all installed packages.

    Rate this question:

  • 16. 

    Which of the following would be considered a host?

    • A.

      The computer’s hard drive

    • B.

      A network cable

    • C.

      A CDROM

    • D.

      A printer attached to the network via an IP address

    Correct Answer
    D. A printer attached to the network via an IP address
    Explanation
    A host refers to a device or a computer system that is connected to a network and is capable of sending or receiving data. In this context, a printer attached to the network via an IP address can be considered a host as it is connected to the network and can receive print jobs from other devices on the network. The computer's hard drive, network cable, and CDROM are not considered hosts as they do not have the capability to send or receive data on a network.

    Rate this question:

  • 17. 

    What option to the netstat command has information shown as numbers rather than names?

    • A.

      -t

    • B.

      -n

    • C.

      -name

    • D.

      -r

    Correct Answer
    B. -n
    Explanation
    The option "-n" in the netstat command displays information as numbers rather than names. This means that instead of showing the names of the network connections, it will display the corresponding numerical IP addresses and port numbers. This can be useful for troubleshooting network issues or for obtaining a more detailed understanding of the network connections.

    Rate this question:

  • 18. 

    Which of the following commands will allow you to log into the machine server1 with the account name nick?

    • A.

      Ssh nick@server1

    • B.

      Ssh nick->server1

    • C.

      Ssh nick-server1

    • D.

      Ssh nick&server1

    Correct Answer
    A. Ssh nick@server1
    Explanation
    The correct answer is "ssh nick@server1". This command uses the SSH protocol to log into the machine named "server1" with the account name "nick". The "@" symbol is used to separate the account name from the server name in SSH commands.

    Rate this question:

  • 19. 

    The RSA key fingerprint allows the dig command to connect to remote systems. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The RSA key fingerprint does not allow the dig command to connect to remote systems. The dig command is primarily used for DNS queries and does not require or use RSA key fingerprints for its functionality. Therefore, the statement is false.

    Rate this question:

  • 20. 

    Which files contain user account information? (choose two)

    • A.

      /etc/shadow

    • B.

      /etc/group

    • C.

      /etc/passwd

    Correct Answer(s)
    A. /etc/shadow
    C. /etc/passwd
    Explanation
    The files /etc/shadow and /etc/passwd contain user account information. The /etc/shadow file stores encrypted passwords for user accounts, while the /etc/passwd file contains basic user account information such as usernames and user IDs. These files are commonly used in Unix-like operating systems to manage user accounts and authentication.

    Rate this question:

  • 21. 

    Sudo privileges can be used to specify which user can use the sudo command to execute commands as other users. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Sudo privileges allow for the specification of which user can use the sudo command to execute commands as other users. This means that certain users can be granted the ability to temporarily elevate their privileges and perform tasks that are typically restricted to other users or the root user. Therefore, the statement that sudo privileges can be used to specify which user can use the sudo command to execute commands as other users is true.

    Rate this question:

  • 22. 

    In distributions that do not allow the root user to login directly or via the su command, the installation process automatically configures one user account to be able to use the sudo command to execute commands as if they were executed by the root user. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In distributions that do not allow the root user to login directly or via the su command, the installation process automatically configures one user account to be able to use the sudo command to execute commands as if they were executed by the root user. This means that the user account has the necessary privileges to perform administrative tasks without actually logging in as the root user. Therefore, the statement is true.

    Rate this question:

  • 23. 

    Which of the following commands will display how long the system has been running since the last boot? (choose two)

    • A.

      Who

    • B.

      W

    • C.

      Id

    • D.

      Uptime

    Correct Answer(s)
    B. W
    D. Uptime
    Explanation
    The commands "w" and "uptime" can be used to display how long the system has been running since the last boot. The "w" command shows the current system time and the duration since the last boot, while the "uptime" command specifically provides information about the system uptime. Both commands are commonly used in Linux and Unix systems to check the system's uptime.

    Rate this question:

  • 24. 

    The /etc/shadow file contains plain-text passwords. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false. The /etc/shadow file does not contain plain-text passwords. It is a system file on Unix-like operating systems that stores encrypted user passwords. The passwords are hashed and salted, providing an extra layer of security compared to storing them in plain text. This helps protect the passwords from being easily compromised in the event of a security breach.

    Rate this question:

  • 25. 

    Which command can be used to view the /etc/passwd file entries?

    • A.

      Getent

    • B.

      Uptime

    • C.

      Getpasswd

    • D.

      Uppasswd

    Correct Answer
    A. Getent
    Explanation
    The command "getent" can be used to view the /etc/passwd file entries. This command is used to retrieve entries from databases configured in /etc/nsswitch.conf, including the passwd database which contains user account information. By running "getent passwd", the user can view the list of users and their corresponding details stored in the /etc/passwd file.

    Rate this question:

  • 26. 

    Which command can be used to determine a user’s most recent log in?

    • A.

      Login

    • B.

      Last

    • C.

      History

    • D.

      Shell

    Correct Answer
    B. Last
    Explanation
    The command "last" can be used to determine a user's most recent log in. This command displays a list of the most recent logins, including the date, time, and duration of each session. It provides information about the user's activities and can be helpful for monitoring user access and detecting any unauthorized logins.

    Rate this question:

  • 27. 

    Which of the following files contains encrypted user password information?

    • A.

      /etc/usr

    • B.

      /etc/shadow

    • C.

      /etc/passwd

    • D.

      /etc/group

    Correct Answer
    B. /etc/shadow
    Explanation
    The correct answer is /etc/shadow because this file is commonly used in Unix-based systems to store encrypted user password information. It is accessible only by the root user, providing an extra layer of security. The /etc/passwd file, on the other hand, contains user account information but does not store encrypted passwords. The /etc/usr and /etc/group files are unrelated to password information.

    Rate this question:

  • 28. 

    Which of the following files contains user IDs?

    • A.

      /etc/passwd

    • B.

      /etc/group

    • C.

      /etc/shadow

    • D.

      /etc/usr

    Correct Answer
    A. /etc/passwd
    Explanation
    The file "/etc/passwd" contains user IDs. This file is a system file in Unix-like operating systems that stores essential information about each user account on the system, including the user ID. It is used by various system utilities and processes to identify and authenticate users. The "/etc/group" file, on the other hand, contains information about user groups, while the "/etc/shadow" file stores encrypted passwords. The "/etc/usr" file mentioned in the options does not exist and is likely a typo or incorrect option.

    Rate this question:

  • 29. 

    Which of the following files does the groupadd command use to determine the new GID when a GID isn’t specified?

    • A.

      /etc/shadow

    • B.

      /etc/usr

    • C.

      /etc/passwd

    • D.

      /etc/group

    Correct Answer
    D. /etc/group
    Explanation
    The groupadd command uses the /etc/group file to determine the new GID when a GID isn't specified. This file contains information about groups on the system, including their names, GIDs, and the users who are members of each group. By checking this file, the groupadd command can assign a unique GID to a new group that is being created.

    Rate this question:

  • 30. 

    Which of the following commands, run as root, will prevent the user bob from logging in?

    • A.

      Usermod -L bob

    • B.

      Usermod -D bob

    • C.

      Usermod -d bob

    • D.

      Usermod -l bob

    Correct Answer
    A. Usermod -L bob
    Explanation
    The correct answer is "usermod -L bob". The "-L" option in the usermod command locks the user account, preventing the user from logging in.

    Rate this question:

  • 31. 

    The chmod command can be used on a file by:

    • A.

      The file owner and root

    • B.

      The file owner

    • C.

      A user that belongs to the files current group

    • D.

      Only root

    Correct Answer
    A. The file owner and root
    Explanation
    The chmod command allows the file owner and root to modify the permissions of a file. The file owner has the authority to change the permissions of their own files, while root, being the superuser, has the highest level of privilege and can modify the permissions of any file on the system. Other users who belong to the file's current group can also use the chmod command to modify the file's permissions. However, only root has complete control over all files and can modify any file's permissions.

    Rate this question:

  • 32. 

    Which option for the chown command can be used to change the owner of a directory and all the files and directories below it?

    • A.

      -f

    • B.

      -R

    • C.

      -a

    • D.

      -r

    Correct Answer
    B. -R
    Explanation
    The option "-R" for the chown command can be used to change the owner of a directory and all the files and directories below it. This option stands for "recursive" and allows the change of ownership to be applied to all subdirectories and files within the specified directory. By using this option, the ownership of the entire directory tree can be modified in one command.

    Rate this question:

  • 33. 

    The chown command will only accept one file at a time as an argument. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The chown command can accept multiple files as arguments, not just one file at a time. This allows the user to change the ownership of multiple files simultaneously, saving time and effort.

    Rate this question:

  • 34. 

    The “execute” permission is never set on files by default. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    By default, when a file is created, the "execute" permission is not set. This means that the file cannot be executed as a program or script directly. This is a security measure to prevent accidental execution of potentially harmful files. The user must explicitly set the "execute" permission if they want the file to be executable. Therefore, the statement "The 'execute' permission is never set on files by default" is true.

    Rate this question:

  • 35. 

    The user owner of a file will always have the same or higher permissions as “other”. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because the user owner of a file can have lower permissions than "other". The user owner can have specific permissions set for themselves, while "other" refers to all other users who are not the owner. Therefore, it is possible for the user owner to have more restrictive permissions than "other".

    Rate this question:

  • 36. 

    A source and a hard link must be part of the same filesystem. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A source and a hard link must be part of the same filesystem because a hard link is a direct reference to the same inode (data structure that stores information about a file) as the source file. In other words, a hard link creates a new file entry in the filesystem that points to the same data blocks as the source file. Therefore, both the source file and the hard link must be located within the same filesystem.

    Rate this question:

  • 37. 

    Deleting a source file will break an associated symbolic link. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    When a source file is deleted, any symbolic links pointing to it will become invalid or broken. Symbolic links are essentially shortcuts or references to the original file, and if the original file is deleted, the link will no longer be able to access it. Therefore, deleting a source file will break any associated symbolic links.

    Rate this question:

  • 38. 

    A source file and a symbolic link must be part of the same file system. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    A source file and a symbolic link do not have to be part of the same file system. Symbolic links can be used to refer to files or directories in different file systems, allowing for flexibility and organization in file management. Therefore, the correct answer is False.

    Rate this question:

  • 39. 

    Which of the following commands would create a hard link, link to file?

    • A.

      Ln link file

    • B.

      Ln -s link file

    • C.

      Ln file link

    • D.

      Ln -s file link

    Correct Answer
    C. Ln file link
    Explanation
    The correct answer is "ln file link" because the "ln" command is used to create links between files, and the syntax "ln file link" creates a hard link named "link" that points to the file named "file".

    Rate this question:

  • 40. 

    Which of the following commands would create a symbolic link, link to file?

    • A.

      Ln link file

    • B.

      Ln -s file link

    • C.

      Ln file link

    • D.

      Ln -s link file

    Correct Answer
    B. Ln -s file link
    Explanation
    The correct answer is "ln -s file link" because the "-s" option is used to create a symbolic link. The "file" is the original file that we want to link, and "link" is the name of the symbolic link that will be created.

    Rate this question:

Quiz Review Timeline +

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
  • Mar 03, 2018
    Quiz Created by
    Belac
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.