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 a system running the Linux kernel, where are module configuration files typically stored?
- /etc/modprobe.d/
- /var/modules
- /usr/lib/kernel/modules
- /opt/kernelconfig
For a system running the Linux kernel, module configuration files are typically stored in the '/etc/modprobe.d/' directory. These files are used to configure the behavior and options of kernel modules, allowing users to customize module settings and behavior.
To disable the debugging mode that was enabled with set -x, you can use the command __________.
- set +x
- debug off
- stop debug
- quit
To disable the debugging mode that was enabled with set -x, you can use the command **set +x**. This command turns off the debugging mode, so the script will no longer display each command before execution. It's a useful way to end debugging when it's no longer needed.
The tool ________ is used to manage and enforce profiles within AppArmor.
- aa-status
- apparmor-status
- aa-enforce
- apparmor-enforce
The tool aa-enforce is used to manage and enforce profiles within AppArmor. It allows you to enable and enforce AppArmor profiles for specific applications or processes.
In Linux, user-specific configuration files, sometimes starting with a dot (.), are typically located in the _________ directory.
- /bin
- /etc
- /home
- /usr
In Linux, user-specific configuration files, sometimes starting with a dot (.), are typically located in the /home directory. Each user has a home directory under /home where they can store their personalized configuration files and data.
In Red Hat-based systems, the ________ utility is used to manage and configure software repositories.
- yum
- apt-get
- dnf
- zypper
In Red Hat-based systems, the "yum" utility (Yellowdog Updater, Modified) is used to manage and configure software repositories. It allows users to install, update, and remove packages from Red Hat-based distributions.
You're creating a script that should take different actions based on the day of the week. Which Bash construct would be most suitable for this?
- if...else statements
- case statement
- for loop
- while loop
The most suitable Bash construct for taking different actions based on the day of the week is the case statement. You can use case to evaluate the value of the day and define different actions for each day. Options 1, 3, and 4 are not specifically designed for this purpose; they serve different scripting needs.
Which command allows you to change the expiration date of a user's password in Linux?
- chage
- passwd
- usermod
- pwm
The chage command in Linux allows you to change the expiration date of a user's password. It provides a range of options to manage password-related settings, including password expiration.
When a script is not behaving as expected, you can add the _________ option at the top of the script to display each command before it's executed.
- set -x
- debug -on
- trace -all
- verbose -true
When a script is not behaving as expected, you can add the set -x option at the top of the script to display each command before it's executed. This is a valuable debugging technique that helps you identify issues in your script by showing each command as it is processed.
Which of the following is a common method to secure SSH beyond just password authentication?
- Enforcing key-based authentication
- Using a weak password
- Disabling SSH
- Keeping SSH configuration default
A common method to secure SSH beyond just password authentication is to enforce key-based authentication. This method increases security by requiring users to possess a private key in addition to their password, making it much more difficult for unauthorized users to access the system.