Which command displays a visual representation of disk usage in Linux?

  • ncdu
  • dd
  • du
  • df
The correct command to display a visual representation of disk usage in Linux is ncdu. It stands for "NCurses Disk Usage" and provides a detailed and interactive view of disk usage, allowing users to navigate through directories and identify space-consuming files or folders. Unlike the other options, ncdu is specifically designed for this purpose.

The ________ command in Linux is used to send a signal to a process, often used for termination.

  • continue
  • kill
  • pause
  • stop
The kill command in Linux is used to send a signal to a process, often used for termination. It allows you to gracefully terminate or send specific signals to processes, giving you control over their behavior.

In the context of package management, what does the term "repository" refer to?

  • A centralized location where software packages are stored and maintained.
  • A virtual environment used for package testing.
  • A command used to remove packages from a Linux system.
  • A file containing package metadata.
In package management, a "repository" refers to a centralized location where software packages are stored and maintained. These repositories contain packages that can be downloaded, installed, or updated on a Linux system using package management tools.

Which option with the ssh command specifies a different port for connection?

  • -p
  • -s
  • -l
  • -r
The correct option is -p. When using the ssh command, you can specify a different port for the connection using the -p option followed by the port number (e.g., ssh -p 2222 user@hostname). This is useful when an SSH server is configured to listen on a non-default port.

You've been tasked with writing a script that processes input arguments. How would you check if the number of arguments provided to the script is less than 3?

  • if [ "$#" -lt 3 ]
  • if [ "$#" -eq 3 ]
  • if [ "$#" -gt 3 ]
  • if [ "$#" -eq 0 ]
To check if the number of arguments provided to the script is less than 3, you would use if [ "$#" -lt 3 ]. This tests whether the number of script arguments, represented by $#, is less than 3. Option 2 checks if the number of arguments is exactly 3, and Option 3 checks if it's greater than 3. Option 4 checks if there are no arguments.

If you want to store the exit status of a command in a variable, you would typically use the _________ built-in variable.

  • $?
  • $!
  • $#
  • $@
If you want to store the exit status of a command in a variable, you would typically use the $? built-in variable. The $? variable contains the exit status of the last command executed, where 0 usually indicates success, and non-zero values indicate an error or failure.

The ________ file in Linux contains the default boot entry and settings for the bootloader.

  • grub.cfg
  • /etc/passwd
  • init.d
  • /var/log/messages
The "grub.cfg" file in Linux contains the default boot entry and settings for the bootloader. GRUB (Grand Unified Bootloader) is a commonly used bootloader in Linux systems, and its configuration is stored in this file. It determines which operating system and kernel to boot.

What is the primary purpose of QEMU in Linux virtualization?

  • Emulation and virtualization
  • Containerization
  • Paravirtualization
  • Hypervisor-based virtualization
QEMU's primary purpose in Linux virtualization is emulation and virtualization. It can emulate various hardware components and architectures, making it a versatile tool for running virtual machines and testing software on different platforms.

To deny all incoming traffic by default and only allow specific traffic in iptables, one would set the default policy of the INPUT chain to ________.

  • ACCEPT
  • REJECT
  • DROP
  • ALLOW
To deny all incoming traffic by default and only allow specific traffic in iptables, one would set the default policy of the INPUT chain to DROP. This means that any incoming traffic that doesn't match an explicit rule will be dropped by default.

In the context of VPNs in Linux, the _________ protocol is known for its speed and efficiency but may not be as secure as other options.

  • PPTP
  • OpenVPN
  • IPsec
  • L2TP
In the context of VPNs in Linux, the PPTP (Point-to-Point Tunneling Protocol) is known for its speed and efficiency but may not be as secure as other options. PPTP has known vulnerabilities, so it's not recommended for highly sensitive or secure communications.

You are working on a system and want to compile a program from source. You realize you need some development tools. In which directory would you expect to find these tools?

  • /opt
  • /usr/bin
  • /usr/include
  • /usr/local/bin
Development tools, such as compilers and libraries, are commonly found in the /usr/local/bin directory. This directory is used for software that is installed locally and not managed by the system's package manager. It's a common location for development tools.

Which file system is commonly used in many modern Linux distributions and supports journaling?

  • ext4
  • FAT32
  • NTFS
  • HFS+
ext4 is a commonly used file system in many modern Linux distributions. It supports journaling, which helps in maintaining the integrity of the file system, especially in case of sudden system crashes or power failures. Journaling keeps track of changes before they are committed, making it a reliable choice for Linux.