Which command tests for file types and compares values in Bash scripting?
- test
- eval
- exec
- check
In Bash scripting, the test command is used to test for file types and compare values. It is often used with conditional statements like if and elif to perform tests on files, strings, and other expressions. The test command is also equivalent to [ ] in Bash.
When partitioning a disk, what is the primary partition limit on an MBR disk?
- 4
- 2
- 8
- 16
When partitioning a disk using the Master Boot Record (MBR) partitioning scheme, you can create up to 4 primary partitions. This is a limitation of the MBR scheme, and to create more partitions, you would need to use extended or logical partitions.
What is the primary purpose of the visudo command?
- Edit the sudoers file safely
- View system logs
- Manage user passwords
- Install software packages
The primary purpose of the visudo command is to safely edit the sudoers file. The sudoers file specifies which users or groups are allowed to run commands with elevated privileges using sudo. Using visudo is recommended because it checks the syntax of the file and prevents potential errors that could lock you out of your system.
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.
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.
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.
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.
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.
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.
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.