When managing disk partitions, the term _________ refers to a method that allows for spanning a filesystem across multiple physical disks.
- RAID
- LVM
- EXT4
- XFS
When managing disk partitions, the term "LVM" (Logical Volume Manager) refers to a method that allows for spanning a filesystem across multiple physical disks. LVM provides flexibility in managing storage by creating logical volumes that can span multiple physical drives.
In a shell script, the _________ command is used to parse options and arguments.
- grep
- sed
- getopts
- awk
In a shell script, the getopts command is used to parse options and arguments. It's particularly useful for handling command-line options and arguments in a structured way.
You're troubleshooting a network issue and want to see if any dropped packets are occurring on your server's main network interface. Which command would you likely use?
- ifconfig
- netstat
- tcpdump
- iperf
To monitor network traffic and identify dropped packets, you would likely use the "tcpdump" command. Tcpdump is a packet analyzer that allows you to capture and inspect network packets on a specific network interface.
You are writing a Bash script to automate server maintenance. You want to check if a directory exists before trying to create it. Which command would you use within your script to check for the directory's existence?
- if [ -d "$directory" ]
- if [ -e "$directory" ]
- if [ -f "$directory" ]
- if [ -s "$directory" ]
The correct command to check if a directory exists in a Bash script is if [ -d "$directory" ]. This condition tests whether the given directory path, represented by $directory, exists as a directory. Option 2 -e checks for the existence of any file or directory, not specifically a directory. Option 3 -f checks for regular files, and Option 4 -s checks if the file has a size greater than zero.
Docker primarily deals with which kind of virtualization?
- Containerization
- Hypervisor-based virtualization
- Paravirtualization
- Emulation
Docker primarily deals with containerization, which is a lightweight form of virtualization. Containers share the host OS kernel, making them efficient and suitable for packaging and running applications.
What is the primary purpose of the chmod command in Linux?
- Changing file permissions
- Creating new directories
- Deleting files
- Displaying file contents
The primary purpose of the chmod command in Linux is to change file permissions. It allows you to modify the access permissions of files and directories. You can use it to control who can read, write, and execute a particular file or directory.
The _________ special variable in a shell script provides an option for random number generation.
- $RANDOM
- $PID
- $USER
- $HOME
The $RANDOM special variable in a shell script provides an option for random number generation. You can use $RANDOM to generate random integers within a specific range. It's commonly used for tasks like creating random passwords or simulating randomness in scripts.
Which operator would you use in Bash to check if two strings are equal?
- =
- ==
- #NAME?
- equals
In Bash, to check if two strings are equal, you use the == operator. It is used in conditional statements to compare two strings. Remember to enclose the strings in double square brackets for the comparison, like [[ string1 == string2 ]].
The set -x command in a shell script is used to enable __________ for debugging purposes.
- Debugging mode
- Profiling mode
- Tracing mode
- Script execution
The set -x command in a shell script is used to enable debugging mode for debugging purposes. When this mode is activated, the shell script will display each command before it is executed, making it useful for tracking the script's execution and finding errors.
A system administrator wants to dynamically alter the kernel's behavior without rebooting. What feature of the Linux kernel allows for this?
- Sysctl
- init.d
- Kernel Modules
- Udev
The Sysctl feature allows a system administrator to dynamically alter the kernel's behavior without rebooting. It provides a way to modify kernel parameters at runtime, making it a powerful tool for fine-tuning system behavior.