The Ultimate Linux Commands And Networking Test

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 Themes
T
Themes
Community Contributor
Quizzes Created: 410 | Total Attempts: 734,229
Questions: 120 | Attempts: 600

SettingsSettingsSettings
The Ultimate Linux Commands And Networking Test - Quiz

Questions and Answers
  • 1. 

    Which command is used to set the hostname of the local system? (Specify only the command without any path or parameters.)

    Explanation
    The command "hostname" is used to set the hostname of the local system. This command allows users to change or set the name of the system. By running the "hostname" command followed by the desired hostname, the system's name will be updated accordingly.

    Rate this question:

  • 2. 

    Which of the following is a valid IPv6 address?

    • A.

       2001:db8:0g21::1

    • B.

       2001::db8:4581::1

    • C.

       2001:db8:3241::1

    • D.

       2001%db8%9990%%1

    • E.

       2001.db8.819f..1

    Correct Answer
    C.  2001:db8:3241::1
  • 3. 

    What command, depending on its options, can display the open TCP connections, the routing tables, as well as network interface statistics? (Specify only the command without any path or parameters.)

    Correct Answer
    netstat
    Explanation
    The command "netstat" can display various information related to network connections and statistics. Depending on the options used with the command, it can show open TCP connections, routing tables, and network interface statistics.

    Rate this question:

  • 4. 

    Which command included in NetworkManager is a curses application which provides easy acces to the NetworkManager on the command line? (Specify only the command without any path or parameters.)

    Correct Answer
    nmtui
    Explanation
    Nmtui is a command included in NetworkManager that is a curses application. It provides easy access to the NetworkManager on the command line. This means that users can use nmtui to manage their network connections and settings using a simple and intuitive interface in the terminal.

    Rate this question:

  • 5. 

    Which if the following tools, used for DNS debugging, reports not only the response from the name sever but also details about the query?

    • A.

       dnsq

    • B.

       hostname

    • C.

       dig

    • D.

       dnslookup

    • E.

       zoneinfo

    Correct Answer
    C.  dig
    Explanation
    The tool "dig" is used for DNS debugging and it reports not only the response from the name server but also details about the query.

    Rate this question:

  • 6. 

    Which of the following statements is valid in the file /etc/nsswitch.conf?

    • A.

       multi on

    • B.

       192.168.168.4 dns-server

    • C.

       namespaces: net mount procs

    • D.

       include /etc/nsswitch.d/

    • E.

       hosts: files dns

    Correct Answer
    E.  hosts: files dns
    Explanation
    The statement "hosts: files dns" is valid in the file /etc/nsswitch.conf. This statement defines the order in which the system looks up host information. It first checks the local files (/etc/hosts) and then queries the DNS server.

    Rate this question:

  • 7. 

    Which of the following connection types, as seen in nmcli connection show, may exist in NetworkManager? (Choose three.)

    • A.

       tcp

    • B.

       ethernet

    • C.

       wifi

    • D.

       ipv6

    • E.

       bridge

    Correct Answer(s)
    B.  ethernet
    C.  wifi
    E.  bridge
    Explanation
    The correct answer is ethernet, wifi, and bridge. These three connection types are commonly seen in NetworkManager. Ethernet connections are used for wired connections, wifi connections are used for wireless connections, and bridge connections are used to connect multiple networks together. TCP and IPv6 are not connection types, but rather protocols that can be used within these connection types.

    Rate this question:

  • 8. 

    On a Linux workstation, the route command takes a long time before printing out the routing table. Which of the following errors does that indicate?

    • A.

      The local routing information may be corrupted and must be re-validated using a routing protocol.

    • B.

      One of the routers in the routing table is not available which causes the automatic router failure detection mechanism (ARF-D) to wait for a timeout.

    • C.

      There may accidentally be more than one default router in which case a default router election has to be done on the network in order to choose one router as the default.

    • D.

      The Linux Kernel Routing Daemon (LKRD) is not running and should be started using its init script or systemd unit.

    • E.

      DNS resolution may not be working as route by default tries to resolve names of routers and destinations and may run into a timeout.

    Correct Answer
    E. DNS resolution may not be working as route by default tries to resolve names of routers and destinations and may run into a timeout.
    Explanation
    The correct answer suggests that the long time taken by the route command to print out the routing table indicates that DNS resolution may not be working. This is because the route command attempts to resolve names of routers and destinations by default, and if DNS resolution is not functioning properly, it may result in a timeout.

    Rate this question:

  • 9. 

    What is true about the Hop Limit field in the IPv6 header?

    • A.

      The field is not changed during the transport of a package.

    • B.

      The field is transmitted within a hop-by-hop extension header.

    • C.

      Each router forwarding the packet increases the field’s value.

    • D.

      Each router forwarding the packet decreases the field’s value.

    • E.

      For multicast packages, the field’s value is always 1.

    Correct Answer
    D. Each router forwarding the packet decreases the field’s value.
    Explanation
    Each router forwarding the packet decreases the field's value. In IPv6, the Hop Limit field is used to limit the number of hops (routers) that a packet can traverse before being discarded. Each time a packet is forwarded by a router, the Hop Limit field is decremented by 1. This ensures that packets do not endlessly loop in the network and helps prevent congestion. When the Hop Limit field reaches 0, the packet is discarded. Therefore, the correct answer is that each router forwarding the packet decreases the field's value.

    Rate this question:

  • 10. 

    Which of the following nmcli subcommands exist? (Choose two.)

    • A.

       nmcli ethernet

    • B.

       nmcli device

    • C.

       nmcli wifi

    • D.

       nmcli address

    • E.

       nmcli connection

    Correct Answer(s)
    B.  nmcli device
    E.  nmcli connection
    Explanation
    The nmcli command is a command-line tool for managing NetworkManager, which is a software utility used for configuring and managing network connections on Linux systems. The nmcli device subcommand is used to display information about network devices, such as Ethernet or wireless interfaces. The nmcli connection subcommand is used to manage network connections, including creating, editing, and deleting connections. Therefore, the correct answers are nmcli device and nmcli connection.

    Rate this question:

  • 11. 

    Which of the following changes may occur as a consequence of using the command ip? (Choose three.)

    • A.

      Network interfaces may become active or inactive.

    • B.

      New name servers may be added to the resolver configuration.

    • C.

      The system’s host name may change.

    • D.

      IP addresses may change.

    • E.

      The routing table may change.

    Correct Answer(s)
    A. Network interfaces may become active or inactive.
    D. IP addresses may change.
    E. The routing table may change.
    Explanation
    The command "ip" is used for managing network interfaces and IP addresses in a system. By using this command, network interfaces can be activated or deactivated, which means they may become active or inactive. Additionally, the command can be used to configure IP addresses, so it is possible that IP addresses may change as a consequence of using the command. Finally, the command can also be used to manage the routing table, so it is likely that the routing table may change after executing the "ip" command.

    Rate this question:

  • 12. 

    How many IP addresses can be used for unique hosts inside the IPv4 subnet 192.168.2.128/26?

    • A.

      6

    • B.

      14

    • C.

      30

    • D.

      62

    • E.

      126

    Correct Answer
    D. 62
    Explanation
    The given IPv4 subnet is 192.168.2.128/26, which means that the subnet has a network address of 192.168.2.128 and a subnet mask of 26 bits. The subnet mask of 26 bits allows for 2^6 - 2 = 62 usable IP addresses. The "-2" accounts for the network address and the broadcast address, which cannot be assigned to hosts. Therefore, there can be 62 unique hosts inside this IPv4 subnet.

    Rate this question:

  • 13. 

    Which of the following IPv4 networks are reserved by IANA for private address assignment and private routing? (Choose three.)

    • A.

      10.0.0.0/8

    • B.

      127.0.0.0/8

    • C.

      169.255.0.0/16

    • D.

      172.16.0.0/12

    • E.

      192.168.0.0/16

    Correct Answer(s)
    A. 10.0.0.0/8
    D. 172.16.0.0/12
    E. 192.168.0.0/16
    Explanation
    The three IPv4 networks that are reserved by IANA for private address assignment and private routing are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These address ranges are designated for use in private networks and are not routable on the public internet. The 127.0.0.0/8 network is reserved for loopback addresses, which are used for testing network connectivity on a local machine. The 169.255.0.0/16 network is reserved for Automatic Private IP Addressing (APIPA) and is used when a device cannot obtain an IP address from a DHCP server.

    Rate this question:

  • 14. 

    Which of the following commands configure network interfaces based on the system’s existing distribution-specific configuration files? (Choose two.)

    • A.

       ifconf

    • B.

       ifdown

    • C.

       ifpause

    • D.

       ifstart

    • E.

      Ifup

    Correct Answer(s)
    B.  ifdown
    E. Ifup
    Explanation
    The commands "ifdown" and "ifup" configure network interfaces based on the system's existing distribution-specific configuration files. "ifdown" is used to bring down a network interface, disabling its functionality, while "ifup" is used to bring up a network interface, enabling its functionality. Both commands read the configuration files specific to the distribution and apply the necessary settings to the network interface accordingly.

    Rate this question:

  • 15. 

    Which of the following statements is true if the UID of a regular user is identical to the GID of a group?

    • A.

      UID have precedence over GIDs, therefore the user is available while the group doesn’t.

    • B.

      The user as well as the group are not available to avoid ambiguity due to the ID conflict.

    • C.

      UIDs and GIDs are independent of each other, therefore the user as well as the group are still available.

    • D.

      The user is the only member of the group, even if the group configuration contains other members.

    • E.

      GIDs have precedence over UIDs, therefore the group is available while the user isn’t.

    Correct Answer
    C. UIDs and GIDs are independent of each other, therefore the user as well as the group are still available.
    Explanation
    The correct answer is that UIDs and GIDs are independent of each other, therefore the user as well as the group are still available. This means that even if the UID of a regular user is identical to the GID of a group, it does not affect the availability of either the user or the group. The UID and GID serve different purposes and do not have any impact on each other's availability.

    Rate this question:

  • 16. 

    Which of the following information is stored in /etc/shadowfor each user?

    • A.

      The timestamp of the user’s last login

    • B.

      The user’s private SSH keys

    • C.

      The hashed password of the user

    • D.

      The numerical user ID (UID)

    • E.

      The path to the user’s home directory

    Correct Answer
    C. The hashed password of the user
    Explanation
    The /etc/shadow file stores the hashed password of each user. This file is used for authentication purposes and is only accessible by the root user. The hashed password ensures that the actual password is not stored in plain text, providing an additional layer of security.

    Rate this question:

  • 17. 

    Which of the following commands shows all active systemd timers?

    • A.

       systemctl-timer show

    • B.

       timectl list

    • C.

       systemctl –t

    • D.

       systemctl list-timers

    • E.

       timeq

    Correct Answer
    D.  systemctl list-timers
    Explanation
    The correct answer is "systemctl list-timers". This command is used to display all active systemd timers. It provides information about the timers, including their unit names, next run time, and the time left until the next run.

    Rate this question:

  • 18. 

    Which of the following tasks can the date command accomplish? (Choose two.)

    • A.

      Set the system’s date and time.

    • B.

      Set the system’s date but not the time.

    • C.

      Calculate the time span between two dates.

    • D.

      Print a calendar for a month or a year.

    • E.

      Display time in a specific format.

    Correct Answer(s)
    A. Set the system’s date and time.
    E. Display time in a specific format.
    Explanation
    The date command can accomplish the task of setting the system's date and time. It can also display the time in a specific format.

    Rate this question:

  • 19. 

    Which file, if present, must contain all users that are allowed to use the cron scheduling system? (Specify the full name of the file, including path.)

    Correct Answer(s)
    crontab
    Explanation
    The crontab file, located at /etc/crontab, must contain all users that are allowed to use the cron scheduling system. This file specifies the commands and scripts that are scheduled to run at specific times and intervals for each user. By editing the crontab file, users can define their own cron jobs and schedule them accordingly.

    Rate this question:

  • 20. 

    What can be specified with useradd? (Choose two.)

    • A.

      Commands the user can run using sudo.

    • B.

      The absolute path to the user’s home directory.

    • C.

      Which printers are available for the new user.

    • D.

      The SSH keys used to login to the new account.

    • E.

      The numeric user ID (UID) of the user.

    Correct Answer(s)
    B. The absolute path to the user’s home directory.
    E. The numeric user ID (UID) of the user.
    Explanation
    The useradd command can be used to specify the absolute path to the user's home directory and the numeric user ID (UID) of the user.

    Rate this question:

  • 21. 

    What is true about the file /etc/localtime?

    • A.

      It is a plain text file containing a string such as Europe/Berlin

    • B.

      It is created and maintained by the NTP service based on the location of the system’s IP address.

    • C.

      It is a symlink to /sys/device/clock/ltime and always contains the current local time.

    • D.

      After changing this file, newtzconfighas to be run to make the changes effective.

    • E.

      It is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/Europe/Berlin.

    Correct Answer
    E. It is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/Europe/Berlin.
    Explanation
    The file /etc/localtime is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/Europe/Berlin. This file is responsible for storing the timezone information for the system. By linking or copying the appropriate timezone information file to /etc/localtime, the system can accurately determine and display the local time.

    Rate this question:

  • 22. 

    Which of the following statements is true regarding systemd timer units?

    • A.

      Timer units can only be defined within a service unit’s file.

    • B.

      The command executed by the timer is specified in the timer unit’s [Cmd] section.

    • C.

      A dedicated system service, systemd-cron, handles the execution of timer units.

    • D.

      Timer units only exist in the system scope and are not available for users.

    • E.

      Each systemd timer unit controls a specific systemd service unit.

    Correct Answer
    E. Each systemd timer unit controls a specific systemd service unit.
  • 23. 

    Which of the following fields are available in the standard format of both the global /etc/crontab file as well as in user-specific crontab files? (Choose two.)

    • A.

      Year

    • B.

      Minute

    • C.

      Username

    • D.

      Effective group ID

    • E.

      Command

    Correct Answer(s)
    B. Minute
    D. Effective group ID
    Explanation
    In both the global /etc/crontab file and user-specific crontab files, the fields available are Minute and Effective group ID. The Minute field allows the user to specify the minute at which the command should be executed. The Effective group ID field represents the group ID under which the command will be executed. These two fields are common to both types of crontab files.

    Rate this question:

  • 24. 

    Which of the following commands should be executed when starting a login shell in order to change the language of messages for an internationalized program to Portuguese (pt)?

    • A.

       export LANGUAGE=“pt”

    • B.

       export LC_MESSAGES=“pt”

    • C.

       export UI_MESSAGES=“pt”

    • D.

       export MESSAGE=“pt”

    • E.

       export ALL_MESSAGES=“pt”

    Correct Answer
    B.  export LC_MESSAGES=“pt”
    Explanation
    The correct answer is to execute the command "export LC_MESSAGES=“pt”". This command sets the LC_MESSAGES environment variable to "pt", which is the language code for Portuguese. This will change the language of messages for internationalized programs to Portuguese.

    Rate this question:

  • 25. 

    Which of the following files assigns a user to its primary group?

    • A.

       /etc/pgroup

    • B.

       /etc/shadow

    • C.

       /etc/passwd

    • D.

       /etc/group

    • E.

       /etc/gshadow

    Correct Answer
    C.  /etc/passwd
    Explanation
    The correct answer is /etc/passwd. The /etc/passwd file is a text file that contains essential information about user accounts on a Unix-like operating system. It includes the username, encrypted password, user ID, group ID, home directory, and shell of each user. The group ID in this file determines the primary group of a user. Therefore, /etc/passwd is the file that assigns a user to its primary group.

    Rate this question:

  • 26. 

    Which of the following steps prevents a user from obtaining an interactive login session?

    • A.

      Setting the UID for the user to 0.

    • B.

      Running the command chsh –s /bin/false with the user name.

    • C.

      Removing the user from the group staff.

    • D.

      Adding the user to /etc/noaccess.

    • E.

      Creating a .nologin file in the user’s home directory.

    Correct Answer
    B. Running the command chsh –s /bin/false with the user name.
    Explanation
    Running the command chsh –s /bin/false with the user name prevents a user from obtaining an interactive login session. This command changes the user's shell to /bin/false, which is a non-functional shell that does not allow any commands to be executed. As a result, when the user tries to log in, they will immediately be logged out without being able to access the system interactively.

    Rate this question:

  • 27. 

    Which command included in systemd supports selecting messages from the systemd journal by criteria such as time or unit name? (Specify only the command without any path or parameters.)

    Correct Answer
    journalctl
    Explanation
    The command "journalctl" supports selecting messages from the systemd journal by criteria such as time or unit name. It allows users to filter and view logs based on specific time frames or specific units, making it easier to search for and analyze relevant log messages. This command is a powerful tool for troubleshooting and monitoring system events.

    Rate this question:

  • 28. 

    Which of the following statements about systemd-journald are true? (Choose three.)

    • A.

      It is incompatible with syslog and cannot be installed on a system using regular syslog.

    • B.

      It only processes messages of systemd and not messages of any other tools.

    • C.

      It can pass log messages to syslog for further processing.

    • D.

      It maintains metadata such as _UID or _PID for each message.

    • E.

      It supports syslog facilities such as kern, user, and auth.

    Correct Answer(s)
    C. It can pass log messages to syslog for further processing.
    D. It maintains metadata such as _UID or _PID for each message.
    E. It supports syslog facilities such as kern, user, and auth.
    Explanation
    The correct answer is that systemd-journald can pass log messages to syslog for further processing, it maintains metadata such as _UID or _PID for each message, and it supports syslog facilities such as kern, user, and auth. This means that systemd-journald is compatible with syslog and can be installed on a system using regular syslog. It also processes messages from other tools, not just systemd.

    Rate this question:

  • 29. 

    Which command must be run after adding a new email alias to the configuration in order to make this change effective? (Specify the command without any path but including all required parameters.)

    Correct Answer(s)
    newaliases
    Explanation
    The command "newaliases" must be run after adding a new email alias to the configuration in order to make this change effective.

    Rate this question:

  • 30. 

    Which option in the chrony configuration file changes the initial interval of polls to a NTP server in order to speed up the initial synchronization?

    • A.

       iburst

    • B.

       quickstart

    • C.

       fast

    • D.

       fsync

    • E.

       flood

    Correct Answer
    A.  iburst
    Explanation
    The option "iburst" in the chrony configuration file changes the initial interval of polls to a NTP server in order to speed up the initial synchronization. It sends a burst of eight packets instead of the usual one packet, which helps to quickly establish synchronization with the server. This is useful when the system clock is far from the correct time and needs to be synchronized quickly.

    Rate this question:

  • 31. 

    Which of the following commands is used to rotate, compress, and mail system logs?

    • A.

       logrotate

    • B.

       striplog

    • C.

       syslogd –-rotate

    • D.

       rotatelog

    • E.

       logger

    Correct Answer
    A.  logrotate
    Explanation
    The correct answer is "logrotate". Logrotate is a command used to rotate, compress, and mail system logs. It is a utility that automatically manages log files, ensuring that they do not grow too large and take up excessive disk space. It can compress old log files to save space and also send them via email for further analysis or archiving. This command is commonly used in Linux systems to maintain and manage log files efficiently.

    Rate this question:

  • 32. 

    Why is the correct configuration of a system’s time zone important?

    • A.

      Because the timezone is included in checksum calculations and timezone changes invalidate existing checksums.

    • B.

      Because the time zone is saved as part of the modification times of files and cannot be changed after a file is created.

    • C.

      Because the environment variables LANG and LC_MESSAGES are, by default, set according to the time zone.

    • D.

      Because NTP chooses servers nearby based on the configured time zone.

    • E.

      Because the conversion of Unix timestamps to local time relies on the time zone configuration.

    Correct Answer
    E. Because the conversion of Unix timestamps to local time relies on the time zone configuration.
    Explanation
    The correct configuration of a system's time zone is important because the conversion of Unix timestamps to local time relies on the time zone configuration. Unix timestamps are a way to represent time as a single number, and the conversion to local time requires knowledge of the time zone in order to accurately determine the corresponding date and time. Therefore, if the time zone is not correctly configured, the conversion of Unix timestamps to local time will be incorrect, leading to inaccurate time-related operations and calculations.

    Rate this question:

  • 33. 

    Which command, available with all sendmail-compatible MTAs, is used to list the contents of the MTA’s mail queue? (Specify only the command without any path or parameters.)

    Correct Answer
    mailq
    Explanation
    The command "mailq" is used to list the contents of the MTA's mail queue. It is available with all sendmail-compatible MTAs. By running this command, users can view information about the emails in the queue, such as the sender, recipient, and status of each message. This can be useful for troubleshooting email delivery issues or monitoring the MTA's performance.

    Rate this question:

  • 34. 

    What is the top-level directory which contains the configuration files for CUPS? (Specify the full path to the directory.)

    Correct Answer
    /etc/cups/ cups-files.conf
    Explanation
    The top-level directory that contains the configuration files for CUPS is "/etc/cups/". The specific configuration file within this directory is "cups-files.conf".

    Rate this question:

  • 35. 

    Which of the following commands lists all queued print jobs?

    • A.

       lpd

    • B.

       lpr

    • C.

       lp

    • D.

       lsq

    • E.

       lpq

    Correct Answer
    E.  lpq
    Explanation
    The lpq command is used to list all queued print jobs. This command allows users to view information about their print jobs, such as the job ID, the user who submitted the job, the size of the job, and the current status of the job in the print queue. It provides a convenient way to monitor and manage print jobs in a Unix-like operating system.

    Rate this question:

  • 36. 

    36.Which of the following entries in /etc/syslog.conf writes all mail related events to the file /var/log/maillog and sends all critical events to the remote server logger.example.com?

    • A.

       mail.* /var/log/maillog  mail,crit @logger.example.org

    • B.

       mail.* /var/log/maillog  mail.crit syslog://logger.example.org

    • C.

       mail /var/log/maillog  mail.crit @logger.example.org

    • D.

       mail.* /var/log/maillog  mail.crit @logger.example.org

    • E.

       mail * /var/log/maillog  mail crit @logger.example.org

    Correct Answer
    D.  mail.* /var/log/maillog  mail.crit @logger.example.org
    Explanation
    The correct answer is "mail.* /var/log/maillog" because it uses the wildcard "*" to match all events related to mail and directs them to the file /var/log/maillog. Additionally, it specifies that all critical events should be sent to the remote server logger.example.org.

    Rate this question:

  • 37. 

    Which option in the /etc/ntp.conffile specifies an external NTP source to be queried for time information?(Specify only the option without any values or parameters.)

    Correct Answer
    server
    Explanation
    The option "server" in the /etc/ntp.conf file specifies an external NTP source to be queried for time information. This option allows the system to synchronize its time with the specified NTP server, ensuring accurate timekeeping. By specifying the server option, the system can retrieve time information from the designated NTP server and adjust its own clock accordingly.

    Rate this question:

  • 38. 

    Which of the following protocols is related to the term open relay?

    • A.

       SMTP

    • B.

       POP3

    • C.

       NTP

    • D.

       IMAP

    • E.

       LDAP

    Correct Answer
    A.  SMTP
    Explanation
    SMTP (Simple Mail Transfer Protocol) is the correct answer because it is a protocol used for sending and receiving email messages between servers. An open relay refers to an SMTP server that allows anyone to send email through it, without requiring any authentication. This can be exploited by spammers to send large volumes of unsolicited emails, leading to abuse and potential security risks.

    Rate this question:

  • 39. 

    Which of the following commands displays all environment and shell variables?

    • A.

       getargs

    • B.

       lsenv

    • C.

       ls

    • D.

       env

    • E.

       lsshell

    Correct Answer
    D.  env
    Explanation
    The command "env" displays all environment and shell variables. It is used to show the current environment variables and their values in a Unix-like operating system.

    Rate this question:

  • 40. 

    Which of the following comparison operators for test work on elements in the file system? (Choose two.)

    • A.

       –z

    • B.

       –eq

    • C.

       –d

    • D.

       –f

    • E.

       –lt

    Correct Answer(s)
    C.  –d
    D.  –f
    Explanation
    The comparison operators -d and -f work on elements in the file system. The -d operator checks if a file is a directory, while the -f operator checks if a file is a regular file. These operators are commonly used in shell scripting to perform conditional checks on files and directories.

    Rate this question:

  • 41. 

    What information is provided by the echo $$ command?

    • A.

      The process ID of the current shell.

    • B.

      The process ID for the following command.

    • C.

      The process ID of the last command executed.

    • D.

      The process ID of the last command which has been placed in the background.

    • E.

      The process ID of the echo command.

    Correct Answer
    A. The process ID of the current shell.
    Explanation
    The echo $$ command provides the process ID of the current shell.

    Rate this question:

  • 42. 

    Which command makes the shell variable named VARIABLE visible to subshells?

    • A.

       export $VARIABLE

    • B.

       env VARIABLE

    • C.

       set $VARIABLE

    • D.

       set VARIABLE

    • E.

       export VARIABLE

    Correct Answer
    E.  export VARIABLE
    Explanation
    The correct answer is "export VARIABLE". The export command is used to make shell variables visible to subshells. When a variable is exported, it becomes part of the environment of any subshells that are created. This means that the variable can be accessed and used by any commands or scripts running in those subshells.

    Rate this question:

  • 43. 

    What output is produced by the following command sequence? echo ‘1 2 3 4 5 6’ | while read a b c; do echo result $c $b $a; done

    • A.

       result: 6 5 4

    • B.

       result: 1 2 3 4 5 6

    • C.

       result: 3 4 5 6 2 1

    • D.

       result: 6 5 4 3 2 1

    • E.

       result: 3 2 1

    Correct Answer
    C.  result: 3 4 5 6 2 1
    Explanation
    The given command sequence takes the string "1 2 3 4 5 6" as input and uses the "read" command to assign the values to variables a, b, and c. Then, it prints the output in the format "result c b a". In the first iteration, c=6, b=5, and a=4, so the output is "result: 6 5 4".

    Rate this question:

  • 44. 

    Which of the following configuration files should be modified to globally set shell variables for all users?

    • A.

       /etc/profile

    • B.

       /etc/bashrc

    • C.

       ~/.bash_profile

    • D.

       /etc/.bashrc

    • E.

       /etc/shellenv

    Correct Answer
    A.  /etc/profile
    Explanation
    The correct answer is /etc/profile. This file is a system-wide configuration file that is executed for login shells. It is used to set environment variables and execute commands that should be available to all users on the system. Modifying this file allows for the global setting of shell variables for all users.

    Rate this question:

  • 45. 

    What output does the command seq 10 produce?

    • A.

      A continuous stream of numbers increasing in increments of 10 until the command is stopped.

    • B.

      It creates no output because a second parameter is missing.

    • C.

      The number 0 through 9 with one number per line.

    • D.

      The number 10 to standard output.

    • E.

      The numbers 1 through 10 with one number per line.

    Correct Answer
    E. The numbers 1 through 10 with one number per line.
    Explanation
    The command "seq 10" produces the numbers 1 through 10 with one number per line.

    Rate this question:

  • 46. 

    What command list the aliases defined in the current Bash shell? (Specify only the command without any path or parameters.)

    Correct Answer
    alias
    Explanation
    The command "alias" lists the aliases defined in the current Bash shell. Aliases are shortcuts or alternate names for commands, allowing users to create their own custom commands or abbreviations. By running the "alias" command, users can view a list of all the aliases that have been defined in their current shell session.

    Rate this question:

  • 47. 

    Which of the following commands can be used to limit the amount of memory a user may use?

    • A.

       umask

    • B.

       usermod

    • C.

       passwd

    • D.

       ulimit

    • E.

       chage

    Correct Answer
    D.  ulimit
    Explanation
    The ulimit command can be used to limit the amount of memory a user may use. This command allows system administrators to set various resource limits for users, including memory limits. By using ulimit, the system administrator can restrict the amount of memory that a user or a process can consume, preventing excessive memory usage and ensuring fair allocation of system resources.

    Rate this question:

  • 48. 

    What is a purpose of an SSH host key?

    • A.

      It must be sent by any SSH client in addition to a user key in order to identify the client’s host.

    • B.

      It is root key by which all user SSH keys must be signed.

    • C.

      It provides the server’s identity information to connecting SSH clients.

    • D.

      It authenticates any user that logs into a remote machine from the key’s host.

    • E.

      It is used by system services like cron, syslog or a backup job to automatically connect to remote hosts.

    Correct Answer
    C. It provides the server’s identity information to connecting SSH clients.
    Explanation
    The purpose of an SSH host key is to provide the server's identity information to connecting SSH clients. This allows clients to verify the authenticity of the server they are connecting to and ensure that they are not connecting to a malicious or impersonating server. The SSH host key is used during the initial connection handshake to establish a secure and encrypted communication channel between the client and the server.

    Rate this question:

  • 49. 

    What is the purpose of TCP wrapper?

    • A.

      Manage and adjust bandwidth used by TCP services.

    • B.

      Bind a network service to a TCP port.

    • C.

      Encapsulate TCP messages in IP packets.

    • D.

      Add SSL support to plain text TCP services.

    • E.

      Limit access to a network service.

    Correct Answer
    E. Limit access to a network service.
    Explanation
    The purpose of TCP wrapper is to limit access to a network service. TCP wrapper is a security feature that acts as a filter between a network service and the internet. It allows administrators to control which hosts or networks are allowed to connect to a particular service. By specifying access rules in the TCP wrapper configuration file, administrators can restrict access to only authorized users or networks, thereby enhancing the security of the network service.

    Rate this question:

  • 50. 

    Given the following excerpt of the sudo configuration: Jane ANY=NOPASSWD: /bin/kill, /bin/id, PASSWD: /sbin/fdisk Which of the following statements are true? (Choose three.)

    • A.

      Jane can run /bin/id only after specifying her password.

    • B.

      Jane can run /sbin/fdisk after specifying root’s password.

    • C.

      Jane can run /sbin/fdiskafter specifying her password.

    • D.

      Jane can run /bin/kill without specifying a password.

    • E.

      Jane can run /bin/id without specifying her password.

    Correct Answer(s)
    C. Jane can run /sbin/fdiskafter specifying her password.
    D. Jane can run /bin/kill without specifying a password.
    E. Jane can run /bin/id without specifying her password.
    Explanation
    The given excerpt of the sudo configuration allows Jane to run /sbin/fdisk after specifying her password. It also allows her to run /bin/kill without specifying a password and /bin/id without specifying her password.

    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
  • Dec 29, 2020
    Quiz Created by
    Themes
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.