You're troubleshooting a software installation issue on a CentOS machine. You suspect a required package might be missing. Which command helps you check if a specific package is installed?
- rpm -q
- dpkg -l
- yum info
- apt-cache policy
On CentOS, you can use the 'rpm -q' command to check if a specific package is installed. This command queries the RPM database to determine if the package is installed on the system.
If a script is called with ./myscript.sh arg1 arg2 arg3, what does $2 represent?
- The total number of arguments passed to the script.
- The name of the script itself (myscript.sh).
- The second argument, which is "arg2".
- The process ID of the script.
In the given example, $2 represents the second argument passed to the script, which is "arg2". It's important to note that in shell scripting, arguments are accessed using positional parameters like $1, $2, $3, and so on.
You are an administrator and receive a report that a user is not able to execute certain commands with sudo. Where would you primarily look to diagnose the issue?
- /etc/sudoers file
- /etc/passwd file
- /var/log/auth.log
- /bin/sudo binary
To diagnose the issue of a user not being able to execute certain commands with sudo, you would primarily look at the /etc/sudoers file. This file contains the configuration for sudo privileges, and it's the first place to check for any restrictions or misconfigurations that might be affecting the user's access.
Which tool in Linux can be used to measure disk input/output statistics?
- iostat
- top
- ps
- df
The iostat tool in Linux is used to measure disk input/output statistics. It provides information about disk utilization, I/O wait times, and other important metrics, helping system administrators monitor and troubleshoot disk performance.
In package management, a ________ is a collection of patches, configuration files, and scripts that adapt a software source code to a particular distribution.
- Source Package
- Binary Package
- Source Code
- Dependency
In package management, a "Source Package" is a collection of patches, configuration files, and scripts that adapt a software source code to a particular distribution. Source packages are used to build binary packages specific to a particular Linux distribution.
To diagnose potential issues with domain name resolution, you might use the ________ command.
- nslookup
- ifconfig
- ping
- dig
To diagnose potential issues with domain name resolution, you might use the "dig" command. "dig" (Domain Information Groper) is a powerful command-line tool for querying DNS (Domain Name System) servers and obtaining detailed information about DNS records and name resolution, making it useful for troubleshooting DNS-related problems.
In terms of file permissions, what does the "s" stand for when seen in a permission string like "drwxr-sr-x"?
- Set user or group ID
- Special permissions
- Sticky bit
- Synchronized access
The "s" in a permission string like "drwxr-sr-x" signifies the "Set user or group ID" permission. When set on an executable file, it allows the user who runs the file to temporarily inherit the permissions of the file's owner or group, depending on where it's set (user or group ID).
In the context of performance tuning, what does the 'vm.swappiness' parameter control?
- The balance between swapping out and caching application data
- The number of processes a user can start
- The kernel's version number
- The I/O scheduler used by the system
The 'vm.swappiness' parameter controls the balance between swapping out and caching application data in Linux. It determines how often the system will swap data from RAM to disk and vice versa. A lower value (e.g., 0) keeps more data in RAM, while a higher value (e.g., 100) swaps data out more aggressively.
For optimizing database performance, you might adjust the __________ parameter to control disk caching behavior.
- vm.dirty_ratio
- ifconfig
- lsusb
- grep
For optimizing database performance, you might adjust the vm.dirty_ratio parameter to control disk caching behavior. This parameter in the sysctl settings defines the percentage of system memory that can be filled with dirty data pages before the kernel starts writing them to disk, which can impact database I/O performance.
Kernel modules that are loaded during the boot process are typically defined in the _________ directory.
- /lib/modules
- /boot
- /etc/kernel
- /var/modules
The correct option is /lib/modules. Kernel modules (device drivers and other kernel extensions) that are loaded during the boot process are typically defined in the /lib/modules directory. This directory contains subdirectories for different kernel versions and modules specific to those versions.