In Linux, which mechanism allows users to execute commands as another user, typically the superuser?
- sudo
- su
- runas
- impersonate
The sudo command in Linux allows users to execute commands as another user, typically the superuser (root). It provides a fine-grained control mechanism for delegating administrative privileges while maintaining an audit trail of who executed which commands with elevated privileges.
Which tool is used for orchestrating multiple Docker containers?
- Docker Compose
- Docker Swarm
- Kubernetes
- Ansible
Kubernetes is used for orchestrating multiple Docker containers. It's a powerful container orchestration platform that automates the deployment, scaling, and management of containerized applications.
KVM stands for Kernel-based Virtual _________.
- Machine
- Manager
- Memory
- Module
KVM stands for Kernel-based Virtual Machine. It is a Linux kernel module that enables hardware-assisted virtualization, allowing you to run multiple virtual machines on a single host.
Which file system is designed to offer advanced features such as pooling, snapshots, and checksums?
- Btrfs
- ext3
- XFS
- JFS
Btrfs (B-Tree File System) is designed to offer advanced features such as data pooling, snapshots, and checksums. It is a next-generation file system that provides data integrity and efficient storage management. Btrfs is often used in modern Linux distributions for its advanced capabilities.
What is the primary purpose of the df command in Linux?
- Display disk space usage
- List all files in a directory
- Execute a shell script
- Calculate file checksums
The primary purpose of the df command is to display disk space usage on a Linux system. It provides information about the disk space used and available on various mounted filesystems. This command is useful for monitoring disk space to prevent overflows.
When debugging a shell script, which option can be used with the bash command to enable debugging output?
- #NAME?
- #NAME?
- #NAME?
- #NAME?
When debugging a shell script, you can use the -x option with the bash command to enable debugging output. This option displays each command as it is executed, making it useful for identifying issues and understanding the script's execution flow.
What is the primary purpose of the groupmod command in Linux?
- Modify group attributes
- Add a new group
- Remove a user from a group
- Create a new group
The primary purpose of the groupmod command in Linux is to modify group attributes. You can use groupmod to change properties of an existing group, such as its name or GID (Group ID). It does not create new groups or remove users from groups; it focuses on group attribute modifications.
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.
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.
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'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.
In Linux, the ________ command is used to create symbolic links between files.
- connect
- link
- ln
- symlink
In Linux, the "ln" command is used to create symbolic links between files. A symbolic link is a reference to another file or directory, allowing you to access the linked content from a different location in the file system.