Linux Quiz

Description: Linux Quiz
Number of Questions: 20
Created by:
Tags: linux
Attempted 0/20 Correct 0 Score 0

You forget the root password. You decide to reboot using a boot disk floppy. What do you need to do to recover the root password?

  1. Mount the main partition, edit the /etc/passwd file to remove the root password, reboot.

  2. Mount the root partition, edit the /etc/passwd file to remove the root password, reboot.

  3. Mount the main partition, edit the /tmp/passwd file to remove the root password, reboot

  4. Mount the root partition, edit the /etc/passwds file to remove the root password, reboot

  5. none of the above


Correct Option: B
Explanation:

To recover the root password, the user needs to boot the system using a boot disk floppy. Then, they need to mount the root partition and edit the /etc/passwd file to remove the root password. Option C is the correct answer.

Option A is incorrect because it does not provide any solution to recover the root password.

Option B is incorrect because it suggests to mount the main partition instead of the root partition. Editing the /etc/passwd file of the main partition will not affect the root password.

Option D is incorrect because it suggests to edit the /tmp/passwd file instead of the /etc/passwd file. The /tmp directory is used for temporary files, and editing the /tmp/passwd file will not affect the root password.

Option E is incorrect because it suggests to edit the /etc/passwds file instead of the /etc/passwd file. There is no such file as /etc/passwds, so this option is invalid.

The Answer is: C. Mount the root partition, edit the /etc/passwd file to remove the root password, reboot.

The previous system administrator put useless messages at login, what file do you edit to change the system message?

  1. /etc/motd

  2. /etc/str

  3. /etc/strtms

  4. /etc/.conf


Correct Option: A

Users on your network cannot print to a Linux printer. You decide to restart the printer daemon, which command would achieve that?

  1. topq printer-name

  2. enable printer-name

  3. restart printer-name

  4. up printer-name


Correct Option: C
Explanation:

To solve this question, the user needs to know the basic command to restart a printer daemon in Linux.

Now, let's go through each option and explain why it is right or wrong:

A. topq printer-name: This option is incorrect because the command "topq" is not a valid command in Linux. It does not exist and cannot be used to restart a printer daemon.

B. enable printer-name: This option is incorrect because the command "enable" is used to enable a printer, not restart the printer daemon. It does not restart the printer daemon.

C. restart printer-name: This option is incorrect because the command "restart" is not the correct command to restart a printer daemon in Linux. The correct command to restart the printer daemon is "systemctl restart cups".

D. up printer-name: This option is incorrect because the command "up" is not a valid command to restart a printer daemon. It does not exist in Linux.

The correct answer is:

The Answer is: C. restart printer-name

Which file does Linux use to resolve hostnames?

  1. /etc/hostname.conf

  2. /etc/dns.conf

  3. /etc/host.conf

  4. /etc/resolve.conf


Correct Option: C

AI Explanation

To answer this question, you need to understand how Linux resolves hostnames.

Linux uses the /etc/host.conf file to resolve hostnames. This file contains the configuration settings for the hostname resolution process.

Let's go through each option to understand why it is correct or incorrect:

Option A) /etc/hostname.conf - This option is incorrect because Linux does not use the /etc/hostname.conf file to resolve hostnames.

Option B) /etc/dns.conf - This option is incorrect because Linux does not use the /etc/dns.conf file to resolve hostnames.

Option C) /etc/host.conf - This option is correct. Linux uses the /etc/host.conf file to resolve hostnames. This file contains the configuration settings for the hostname resolution process.

Option D) /etc/resolve.conf - This option is incorrect. While the /etc/resolve.conf file exists in Linux systems, it is used to configure the DNS (Domain Name System) resolver, not for hostname resolution.

The correct answer is C) /etc/host.conf. This option is correct because Linux uses the /etc/host.conf file to resolve hostnames.

What is "tin"?

  1. Terminal Interpreter

  2. The command to change the time

  3. The command to compare text files

  4. A newsreader


Correct Option: D

What are the file attributes for executing Perl programs?

  1. 666

  2. 755

  3. 766

  4. 777


Correct Option: B

What is bash?

  1. Something you do to a watermelon

  2. A command to delete multiple files

  3. A network bit format

  4. A command shell


Correct Option: D

What is the DOS LPT1 port in Linux?

  1. /dev/lpt0

  2. /dev/lpt1

  3. /dev/lp0

  4. /dev/lp1

  5. DOSLPT1


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of the DOS LPT1 port and its equivalent in Linux.

In DOS (Disk Operating System), LPT1 is a parallel port used for connecting printers or other parallel devices. In Linux, parallel ports are represented as device files under the /dev directory.

The correct answer is option C) /dev/lp0. In Linux, the equivalent device file for the DOS LPT1 port is /dev/lp0. This means that if you want to access the parallel port in Linux, you would use /dev/lp0 instead of LPT1.

Option A) /dev/lpt0 - This option is incorrect because the correct device file for the DOS LPT1 port in Linux is /dev/lp0, not /dev/lpt0.

Option B) /dev/lpt1 - This option is incorrect because the correct device file for the DOS LPT1 port in Linux is /dev/lp0, not /dev/lpt1.

Option C) /dev/lp0 - This option is correct because the device file /dev/lp0 is the equivalent of the DOS LPT1 port in Linux.

Option D) /dev/lp1 - This option is incorrect because the correct device file for the DOS LPT1 port in Linux is /dev/lp0, not /dev/lp1.

Option E) DOSLPT1 - This option is incorrect because the equivalent device file in Linux is not called DOSLPT1. In Linux, it is represented as /dev/lp0.

The correct answer is option C) /dev/lp0. This option is correct because it represents the equivalent device file for the DOS LPT1 port in Linux.

You attempt to remove a directory, but Linux won't allow you, what is the most likely problem?

  1. The directory name contains illegal characters

  2. You are not logged in as root

  3. The hard disk is full

  4. The directory is not empty

  5. None are likely problems


Correct Option: D

AI Explanation

To answer this question, we need to understand the reasons why Linux might not allow the removal of a directory.

Option A) The directory name contains illegal characters - This option is unlikely to be the problem. While certain characters may be restricted in directory names, it is uncommon for this to prevent the removal of a directory.

Option B) You are not logged in as root - This option is also unlikely to be the problem. While being logged in as the root user provides greater privileges and permissions, it does not necessarily restrict the removal of a directory.

Option C) The hard disk is full - This option is also unlikely to be the problem. If the hard disk is full, it may prevent the creation of new files or directories, but it should not prevent the removal of existing ones.

Option D) The directory is not empty - This option is the most likely problem. Linux does not allow the removal of a directory if it is not empty. This is a safety measure to prevent accidental deletion of important files.

Option E) None are likely problems - This option is incorrect since option D is the most likely problem.

The correct answer is Option D - The directory is not empty. This option is correct because if the directory contains any files or subdirectories, Linux will not allow it to be removed until it is empty.

From a command prompt, what does the command "ls" do?

  1. Lists the settings of the OS

  2. Lists the contents of the directory

  3. List command to list contents of files

  4. Finnish words, means to direct a file to a port

  5. None of the Above


Correct Option: B

Which command creates a file system?

  1. fdisk

  2. crfs

  3. mkfs

  4. fs


Correct Option: C

What is the default administrator username?

  1. administrator

  2. admin

  3. superuser

  4. root

  5. head


Correct Option: D

Which of the following are valid Linux wildcards? (Choose all that apply)

    • and ?
  1. /

  2. ?

  3. &

  4. Z


Correct Option: A

AI Explanation

To answer this question, you need to understand Linux wildcards.

Option A) * and ? - This option is correct because * is a wildcard that represents any sequence of characters, and ? is a wildcard that represents any single character.

Option B) / - This option is incorrect because / is not a wildcard. It is used as a directory separator in Linux.

Option C) ? - This option is correct because ? is a wildcard that represents any single character.

Option D) & - This option is incorrect because & is not a wildcard. It is used as a control operator in Linux.

Option E) Z - This option is incorrect because Z is not a wildcard. It is just a letter.

The correct answer is A) * and ?. These wildcards are commonly used in Linux to represent patterns of filenames or commands.

What does the command "ps" do?

  1. Prints the directory

  2. Shows what processes are running

  3. Print status of LPT1

  4. Produces system statistics

  5. None of the above


Correct Option: B
Explanation:

To understand what the command "ps" does, the user needs to have knowledge about command line interfaces and operating systems.

The correct answer is:

B. Shows what processes are running

Explanation:

The "ps" command is a command used in Unix-like operating systems (such as Linux and macOS) to display information about the currently running processes on the system. It provides a snapshot of the processes running at the time the command is executed, including details such as the process ID (PID), CPU and memory usage, and the parent process ID (PPID). This information is useful for monitoring system resources, troubleshooting performance issues, and managing processes on the system.

Let's go through the other options:

A. Prints the directory: This option is incorrect. The "ps" command does not print the directory. To print the current directory in a command line interface, the "pwd" command is used.

C. Print status of LPT1: This option is incorrect. The "ps" command does not print the status of LPT1. LPT1 is a parallel port used for connecting printers in older systems.

D. Produces system statistics: This option is partially incorrect. While the "ps" command displays information about processes running on the system, it does not provide comprehensive system statistics. For system statistics, other commands like "top" or "sar" may be used.

E. None of the above: This option is incorrect. As explained above, option B is the correct answer.

Therefore, the correct answer is:

The Answer is: B. Shows what processes are running

You are working in Linux when a program hits a flaw and stops running. Which command can be used to end the process?

  1. kill

  2. stop

  3. end

  4. wait

  5. CTL-ALT-DEL


Correct Option: A

AI Explanation

To answer this question, we need to understand how to terminate a process in Linux.

Option A) kill - This option is correct because the "kill" command is used to terminate a process in Linux. The kill command sends a signal to a process, and by default, it sends the SIGTERM signal which terminates the process gracefully. If the process does not respond to the SIGTERM signal, you can send the SIGKILL signal using the "-9" option to forcefully terminate the process.

Option B) stop - This option is incorrect because there is no specific "stop" command in Linux to terminate a process. The correct command is "kill".

Option C) end - This option is incorrect because there is no specific "end" command in Linux to terminate a process. The correct command is "kill".

Option D) wait - This option is incorrect because the "wait" command is used to wait for a process to complete, not to terminate a process.

Option E) CTL-ALT-DEL - This option is incorrect because pressing "CTL-ALT-DEL" in Linux does not directly terminate a process. It opens the system's task manager, where you can manually select and terminate a process.

The correct answer is A) kill. This option is correct because the "kill" command is used to terminate a process in Linux.

A user is logged into the Linux workstation, what is the best way to login to root from a shell prompt?

  1. login root

  2. chuser root

  3. su

  4. root


Correct Option: C

Linux allows filenames up to what number of characters?

  1. 8

  2. 11

  3. 256

  4. 512

  5. Unlimited


Correct Option: C

T/F: The command "pwd" displays the directory

  1. True

  2. False


Correct Option: A

T/F: To move files, use the "move" command.

  1. True

  2. False


Correct Option: B
- Hide questions