What command is used to display the contents of a file in Linux?

  • cat
  • cd
  • ls
  • rm
The cat command is used to display the contents of a file in Linux. It stands for "concatenate" and is often used to view the content of text files on the terminal. You can also use it to create, combine, and display the content of files.

The command ________ provides real-time statistics about network connections, both incoming and outgoing.

  • netstat
  • iftop
  • nmap
  • telnet
The command "iftop" provides real-time statistics about network connections, both incoming and outgoing. It displays a list of network connections and their data transfer rates, making it useful for monitoring network activity.

What is the primary role of the System Call Interface in the Linux kernel?

  • Providing an interface for user programs to interact with the kernel
  • Managing the file system
  • Allocating memory for processes
  • Scheduling processes
The primary role of the System Call Interface in the Linux kernel is to provide an interface for user programs to interact with the kernel. System calls are the gateway through which user applications request services from the kernel, such as file operations, process control, and hardware access.

You're debugging a script and notice that an operation splits a string incorrectly. You suspect it might be related to the field separator. Which built-in variable should you check?

  • IFS (Internal Field Separator)
  • FS (Field Separator)
  • OFS (Output Field Separator)
  • RS (Record Separator)
You should check the IFS (Internal Field Separator) built-in variable. It determines how fields are separated when splitting strings. Changing the IFS value can affect string splitting and tokenization in scripts, so it's essential to inspect and modify it when debugging string manipulation issues.

For an SSH server, the main configuration file is found at /etc/ssh/________.

  • sshd_config
  • server.conf
  • ssh_config
  • main.conf
For an SSH server, the main configuration file is found at /etc/ssh/**sshd_config**. This file contains various settings for the SSH server, including authentication methods, allowed users, and more.

In shell scripting, a loop that processes each item in a list one by one is known as a _________ loop.

  • for
  • while
  • until
  • foreach
In shell scripting, a loop that processes each item in a list one by one is known as a for loop. The "for" loop allows you to iterate through a list of items, such as files or elements in an array, and perform actions on each item. It's a fundamental construct for automation and scripting tasks.

Which file in Linux would you edit to set a system's DNS resolver addresses?

  • /etc/resolv.conf
  • /etc/hostname
  • /etc/dns.conf
  • /etc/networks
To set a system's DNS resolver addresses in Linux, you would edit the /etc/resolv.conf file. This file contains the IP addresses of the DNS servers that the system should use for domain name resolution.

Services in Linux that start at boot and run in the background are commonly referred to as _________.

  • services
  • daemons
  • applications
  • processes
Services in Linux that start at boot and run in the background are commonly referred to as daemons. Daemons are long-running background processes that perform various tasks such as serving network requests, managing hardware devices, and more.

The _________ command provides a snapshot of the current processes in the system.

  • df
  • ls
  • ps
  • top
The ps command in Linux provides a snapshot of the current processes in the system. It displays detailed information about running processes, including their process IDs (PIDs), CPU and memory usage, and other vital statistics.

What command can be used to view the partition table of a disk in Linux?

  • fdisk
  • lsblk
  • diskutil
  • parted
The fdisk command is used to view the partition table of a disk in Linux. It provides a detailed view of the partitions on the disk, their sizes, types, and more.