Linux+ Networking Chapter 4

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 Ajeff
A
Ajeff
Community Contributor
Quizzes Created: 39 | Total Attempts: 53,050
Questions: 20 | Attempts: 885

SettingsSettingsSettings
Linux Plus Networking Quizzes & Trivia

Linux+ Networking Chapter 4


Questions and Answers
  • 1. 

    A directory is a type of file. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A directory is a type of file because it is used to store and organize files and other directories. It acts as a container that holds multiple files and subdirectories within a file system. Directories provide a hierarchical structure for organizing and accessing files on a computer. Therefore, it can be concluded that a directory is indeed a type of file.

    Rate this question:

  • 2. 

    Which command would a user type on the command line to find out what directory in the directory tree he is currently in?

    • A.

      Pd

    • B.

      Cd

    • C.

      Where

    • D.

      Pwd

    Correct Answer
    D. Pwd
    Explanation
    The correct answer is "pwd". The "pwd" command stands for "print working directory" and it is used to display the current directory that the user is in within the directory tree. By typing "pwd" on the command line, the user can quickly find out their current location in the directory structure.

    Rate this question:

  • 3. 

    Which of the following is an absolute pathname?

    • A.

      Home/resume

    • B.

      C:\myfolder\resume

    • C.

      Resume

    • D.

      /home/resume

    • E.

      C:home/resume

    Correct Answer
    D. /home/resume
    Explanation
    An absolute pathname is a complete path that starts from the root directory. In the given options, "/home/resume" is the only one that starts with a forward slash, indicating that it is an absolute pathname. The other options either have a relative path or include a drive letter, which are not characteristics of an absolute pathname.

    Rate this question:

  • 4. 

    A special device file is used to ___________.

    • A.

      Enable proprietary custom-built devices to work with Linux

    • B.

      Represent hardware devices such as hard disk drives and ports

    • C.

      Keep a list of device settings specific to each individual user

    • D.

      Do nothing in Linux

    Correct Answer
    B. Represent hardware devices such as hard disk drives and ports
    Explanation
    A special device file is used to represent hardware devices such as hard disk drives and ports in Linux. These device files act as a communication interface between the operating system and the hardware devices. They allow the operating system to interact with the hardware devices by reading from or writing to these files, enabling the system to perform operations such as reading data from a hard disk or sending data through a port.

    Rate this question:

  • 5. 

    If a user’s current directory is /home/mary/project1, which command could she use to move to the etc directory directly under the root?

    • A.

      Cd ..

    • B.

      Cd /home/mary/etc

    • C.

      Cd etc

    • D.

      Cd /etc

    • E.

      Cd \etc

    Correct Answer
    D. Cd /etc
    Explanation
    The user can move to the etc directory directly under the root by using the command "cd /etc". This command changes the current directory to the etc directory located at the root of the file system.

    Rate this question:

  • 6. 

    After typing the ls –a command, you notice that there is a file whose filename begins with a dot ( . ). What does this mean?

    • A.

      It is a binary file.

    • B.

      It is a system file.

    • C.

      It is a file in the current directory.

    • D.

      It is a hidden file.

    Correct Answer
    D. It is a hidden file.
    Explanation
    A file whose filename begins with a dot ( . ) is considered a hidden file. In Unix-like operating systems, filenames that start with a dot are not displayed by default when using commands like ls. These files are often used to store configuration or preference information that doesn't need to be directly accessed by users on a regular basis. To view hidden files, you can use the -a option with the ls command.

    Rate this question:

  • 7. 

    After typing the ls –F command, you notice a filename that ends with an * asterisk character. What does this mean?

    • A.

      It is a hidden file.

    • B.

      It is a linked file.

    • C.

      It is a special device file.

    • D.

      It is an executable file.

    Correct Answer
    D. It is an executable file.
    Explanation
    The asterisk character at the end of the filename indicates that it is an executable file. In Unix-like systems, such as Linux, the asterisk is often used as a convention to denote executable files. Executable files are programs or scripts that can be run or executed by the operating system.

    Rate this question:

  • 8. 

    The vi editor can function in which two of the following modes? (Choose both that apply.)

    • A.

      Text

    • B.

      Command

    • C.

      Input

    • D.

      Interactive

    • E.

      Insert

    Correct Answer(s)
    B. Command
    E. Insert
    Explanation
    The vi editor can function in two modes: command mode and insert mode. In command mode, users can navigate through the text, delete or copy lines, search for specific words, and perform other editing commands. In insert mode, users can directly type and insert new text into the document. These two modes allow users to efficiently edit and manipulate text in vi editor.

    Rate this question:

  • 9. 

    The less command offers less functionality than the more command. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false. The less command actually offers more functionality than the more command. While both commands are used to view the contents of a file, the less command allows for backward scrolling, searching, and navigation within the file, while the more command only allows for forward scrolling. Therefore, the less command provides additional features and functionality compared to the more command.

    Rate this question:

  • 10. 

    Which command searches for and displays any text contents of a binary file?

    • A.

      Text

    • B.

      Strings

    • C.

      Od

    • D.

      Less

    Correct Answer
    B. Strings
    Explanation
    The "strings" command is used to search for and display any text contents within a binary file. It scans the file for sequences of printable characters and outputs them. This command is commonly used for analyzing binary files, such as executable files or libraries, to extract any readable text strings embedded within them.

    Rate this question:

  • 11. 

    How can a user switch from insert mode to command mode when using the vi editor?

    • A.

      Press the Ctrl+Alt+Del keys simultaneously.

    • B.

      Press the Del key.

    • C.

      Type in a : character.

    • D.

      Press the Esc key.

    Correct Answer
    D. Press the Esc key.
    Explanation
    In the vi editor, the user can switch from insert mode to command mode by pressing the Esc key. This key is used to exit the insert mode and enter the command mode, allowing the user to execute various commands such as saving the file, searching for text, or exiting the editor.

    Rate this question:

  • 12. 

    If resume is the name of a file in the home directory off the root of the filesystem and your present working directory is home, what is the relative name for the file named resume?

    • A.

      /home/resume

    • B.

      /resume

    • C.

      Resume

    • D.

      \home\resume

    Correct Answer
    C. Resume
    Explanation
    The relative name for the file named resume would be "resume". This is because the file is already located in the present working directory, which is home. Therefore, there is no need to include any additional directory paths in the relative name.

    Rate this question:

  • 13. 

    What will the following wildcard regular expression return: file[a-c]?

    • A.

      Filea-c

    • B.

      Filea, filec

    • C.

      Filea, fileb, filec

    • D.

      Fileabc

    Correct Answer
    C. Filea, fileb, filec
    Explanation
    The given wildcard regular expression "file[a-c]?" will return "filea, fileb, filec" as the output. This is because the expression matches any string that starts with "file" followed by a single character that can be any letter between "a" and "c", and may or may not have an additional character at the end. Therefore, it will match "filea", "fileb", and "filec".

    Rate this question:

  • 14. 

    What will typing q! at the : prompt in command mode do when using the vi editor?

    • A.

      Quit as no changes were made

    • B.

      Quit after saving any changes

    • C.

      Nothing as the ! is a metacharacter

    • D.

      Quit without saving any changes

    Correct Answer
    D. Quit without saving any changes
    Explanation
    Typing q! at the : prompt in command mode in the vi editor will quit without saving any changes.

    Rate this question:

  • 15. 

    A user types in the command head  /poems/mary. What will be displayed to the terminal screen?

    • A.

      The first line of the file mary

    • B.

      The header for the file mary

    • C.

      The first 20 lines of the file mary

    • D.

      The last 10 lines of the file mary

    • E.

      The first 10 lines of the file mary

    Correct Answer
    E. The first 10 lines of the file mary
    Explanation
    When the user types in the command "head /poems/mary", the terminal will display the first 10 lines of the file named "mary".

    Rate this question:

  • 16. 

    The tac command _________________.

    • A.

      Is not a valid Linux command

    • B.

      Displays the contents of hidden files

    • C.

      Displays the contents of a file in reverse order last word on the line first and first word on the line last

    • D.

      Displays the contents of a file in reverse order last line first and first line last

    Correct Answer
    D. Displays the contents of a file in reverse order last line first and first line last
    Explanation
    The tac command is used to display the contents of a file in reverse order, with the last line being displayed first and the first line being displayed last.

    Rate this question:

  • 17. 

    How can you specify a text pattern that must be at the beginning of a line of text using a regular expression?

    • A.

      Precede the string with a /.

    • B.

      Follow the string with a \.

    • C.

      Precede the string with a $.

    • D.

      Precede the string with a ^.

    Correct Answer
    D. Precede the string with a ^.
    Explanation
    To specify a text pattern that must be at the beginning of a line of text using a regular expression, you need to precede the string with a ^. The caret symbol (^) is a special character in regular expressions that represents the start of a line. By placing it before the string, you are indicating that the pattern should match only if it appears at the beginning of a line.

    Rate this question:

  • 18. 

    Linux has only one root directory per directory tree. True or False?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Linux does indeed have only one root directory per directory tree. This means that there is a single top-level directory from which all other directories and files branch out. This root directory is denoted by a forward slash ("/") in Linux systems. Having only one root directory helps to maintain a hierarchical structure and organization within the file system.

    Rate this question:

  • 19. 

    Using wildcard metacharacters, how can you indicate a character that is NOT an a or b or c or d?

    • A.

      [^abcd]

    • B.

      Not [a-d]

    • C.

      [!a-d]

    • D.

      !a-d

    Correct Answer
    C. [!a-d]
    Explanation
    The correct answer is [!a-d]. This is because the caret (^) symbol inside the square brackets indicates negation, meaning that any character that is not an a, b, c, or d will match. The other options, [a-d], [^abcd], and !a-d, do not correctly represent the desired condition of not matching any of the specified characters.

    Rate this question:

  • 20. 

    A user typed in the command pwd and saw the output: /home/jim/sales/pending. How could that user navigate to the /home/jim directory?

    • A.

      Cd ..

    • B.

      Cd /jim

    • C.

      Cd ../..

    • D.

      Cd ./.

    Correct Answer
    C. Cd ../..
    Explanation
    The user can navigate to the /home/jim directory by using the command "cd ..". This command moves the user up one level in the directory structure, so by using it twice, the user will be in the /home/jim directory. The other options provided in the question are incorrect. "cd /jim" would try to navigate to a directory called "jim" directly under the root directory, "cd .." would only move the user up one level in the current directory, and "cd ./." would stay in the current directory.

    Rate this question:

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.