In Bash, the ________ construct allows you to execute a specific block of code repeatedly as long as a certain condition is true.
- while
- until
- for
- if
In Bash, the while construct allows you to execute a specific block of code repeatedly as long as a certain condition is true. It's commonly used for creating loops in Bash scripts.
Which command can be used in a shell script to introduce a delay, often used for debugging or to pause the execution?
- sleep
- wait
- pause
- delay
The sleep command is used in a shell script to introduce a delay. You specify the number of seconds to pause the script's execution. It's commonly used for debugging to observe intermediate results or to add pauses for various purposes.
To execute a script in Bash, you often need to make it executable and then use the ________ symbol before the script name.
- ./
- &
- ~
- $
To execute a script in Bash, you often need to make it executable by running chmod +x script_name, and then you use the ./ symbol before the script name to specify the current directory. This tells the shell to execute the script from the current directory.
Which command is used to view the list of scheduled tasks for the system?
- cronlist
- crontab -l
- schedulelist
- tasks
The command "crontab -l" is used to view the list of scheduled tasks (cron jobs) for the system. It lists the cron entries for the currently logged-in user. Scheduled tasks are used to automate various processes at specific times or intervals in a Linux system.
To restrict users from logging in via SSH, you would modify the ________ file.
- /etc/ssh/sshd_config
- /etc/ssh/ssh_config
- /etc/sshd/ssh_config
- /etc/ssh/sshd
To restrict users from logging in via SSH, you would modify the /etc/ssh/sshd_config file. This file contains configuration options for the SSH server, and you can specify access restrictions and settings here.
Which tool enforces mandatory access controls at the kernel level in Linux?
- SELinux
- AppArmor
- UAC
- sudo
SELinux (Security-Enhanced Linux) enforces mandatory access controls at the kernel level in Linux. It provides a powerful and flexible security framework that allows administrators to define fine-grained access policies for processes, files, and resources on a system.
The ___________ distribution is known for its advanced package management system called "pacman."
- Arch
- CentOS
- Fedora
- Ubuntu
The Arch distribution is known for its advanced package management system called "pacman." Arch Linux uses a rolling release model and the pacman package manager for installing, updating, and managing software packages.
What is the primary protocol used by NFS for sharing files?
- NFS
- SMB
- HTTP
- FTP
The primary protocol used by NFS (Network File System) for sharing files is NFS itself. NFS is a network protocol specifically designed for sharing files and directories among networked computers. It is commonly used in Unix and Linux environments.
Which of the following is a valid way to declare a variable in Bash?
- myVar=42
- $myVar = 42
- var myVar = 42
- set myVar 42
A valid way to declare a variable in Bash is by using the format 'myVar=42'. This assigns the value 42 to the variable 'myVar'. The '$' symbol is used to reference the variable.
The ________ statement in Bash allows for decision-making and executing different blocks of code based on a condition.
- if
- for
- while
- switch
The if statement in Bash allows for decision-making. It enables you to execute different blocks of code based on whether a specified condition is true or false. You can use if, elif, and else to handle multiple conditions.