62 Practice Questions & Answers
You need to configure a system to automatically mount a network filesystem at boot time. Which file should you modify to ensure persistent mounting across reboots?
-
A
/etc/mount.conf
-
B
/etc/mtab
-
C
/etc/fstab
✓ Correct
-
D
/proc/mounts
Explanation
/etc/fstab is the static filesystem information file used to configure automatic mounting at boot time. /etc/mtab and /proc/mounts are dynamic and reflect current mounts, while /etc/mount.conf does not exist.
A user reports that their process is consuming excessive CPU resources. You want to see real-time process statistics including CPU and memory usage. Which command should you use?
-
A
top or htop
✓ Correct
-
B
ps aux
-
C
vmstat 1
-
D
iostat -c
Explanation
The top and htop commands provide real-time monitoring of processes with dynamic updates showing CPU and memory usage. The ps command shows static snapshots, while vmstat and iostat focus on system-level statistics rather than individual processes.
You are implementing a backup strategy and need to create incremental backups that only store changes since the last backup. Which backup method should you implement?
-
A
Mirror backups with rsync
-
B
Differential backups only
-
C
Full backup followed by incremental backups
✓ Correct
-
D
Daily full backups with compression
Explanation
Incremental backups store only the changes since the last backup of any kind, providing efficient storage. Differential backups store changes since the last full backup, while mirrors and daily fulls are less efficient for this use case.
When analyzing system performance, you notice high I/O wait time. Which tool provides the most detailed information about disk I/O operations?
-
A
uptime
-
B
iostat
✓ Correct
-
C
lsof
-
D
free
Explanation
iostat provides detailed input/output statistics for devices and partitions. free shows memory usage, uptime shows system uptime and load average, and lsof lists open files but not I/O statistics.
You need to configure SELinux to allow a specific application to read files in a non-standard directory. Which approach is most appropriate?
-
A
Create a custom SELinux policy module for the application
✓ Correct
-
B
Disable SELinux entirely on the system
-
C
Modify /etc/security/limits.conf to grant permissions
-
D
Change file ownership to match the application user
Explanation
Creating a custom SELinux policy module allows fine-grained control while maintaining security. Disabling SELinux removes all protections, changing ownership addresses DAC not MAC, and limits.conf controls resource limits, not file access.
A service fails to start during boot but starts successfully when run manually. What is the most likely cause related to service dependencies?
-
A
The service binary is corrupted
-
B
The service account does not have proper credentials
-
C
Required dependencies are not enabled or have not started yet
✓ Correct
-
D
The service has incorrect file permissions
Explanation
Services with unmet or unstated dependencies may fail during boot when other services haven't started yet. Manual execution works because prerequisite services are already running. File permissions, corruption, and credentials would cause failures in both scenarios.
You want to find all files modified in the last 24 hours across the entire filesystem. Which command is most efficient and appropriate?
-
A
find / -mtime 0
✓ Correct
-
B
find / -mmin -1440
-
C
find / -type f -newer /tmp/timestamp
-
D
ls -ltr | grep yesterday
Explanation
The find command with -mtime 0 locates files modified within the last 24 hours. The -mmin -1440 option also works but -mtime 0 is the standard approach. The -newer option requires a reference file, and ls piping is inefficient for large filesystems.
When configuring a firewall rule using iptables, you need to drop all incoming traffic on port 22 from a specific subnet while allowing established connections. Which rule structure is correct?
-
A
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
-
B
iptables -I INPUT 1 -p tcp --dport 22 -j REJECT --reject-with tcp-reset
-
C
iptables -D INPUT -s 192.168.1.0/24 -p tcp --dport 22
-
D
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT followed by iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j DROP
✓ Correct
Explanation
The correct approach allows established connections first with stateful filtering, then explicitly drops the specified subnet. Option A accepts all port 22 traffic, C deletes rules, and D rejects all port 22 traffic without condition.
You are troubleshooting DNS resolution issues on a client system. Which file contains the list of nameservers the system should query?
-
A
/etc/nsswitch.conf
-
B
/etc/hostname
-
C
/etc/hosts
-
D
/etc/resolv.conf
✓ Correct
Explanation
/etc/resolv.conf specifies the nameservers for DNS queries. /etc/hosts is for static hostname mappings, /etc/hostname stores the system hostname, and /etc/nsswitch.conf configures name service lookup order.
A process is consuming all available memory and is unresponsive. You want to send a signal that allows the process to perform cleanup operations before terminating. Which signal should you use?
-
A
SIGHUP (1)
-
B
SIGKILL (9)
-
C
SIGTERM (15)
✓ Correct
-
D
SIGSTOP (19)
Explanation
SIGTERM (15) allows graceful shutdown with cleanup. SIGKILL (9) forces termination without cleanup, SIGSTOP (19) pauses the process, and SIGHUP (1) is for terminal hangup or configuration reload.
When implementing disk quotas for users, you need to ensure quota limits are enforced at mount time. Which kernel parameter or mount option must be enabled?
-
A
The quotaon command must be run before any users can be limited
-
B
SELinux must be disabled to allow quota enforcement
-
C
The ext4 filesystem must have the quota feature compiled in, and mount options usrquota or grpquota must be set in /etc/fstab
✓ Correct
-
D
The /proc/sys/fs/quota parameter must be set to 1
Explanation
Filesystem quotas require both kernel/filesystem support and mount-time options in /etc/fstab with usrquota or grpquota. quotaon enables quotas after configuration but isn't a prerequisite. SELinux doesn't affect quota functionality, and no such /proc parameter exists.
You need to monitor system resource usage over extended periods for capacity planning. Which tool generates reports of historical system performance data?
-
A
nmon
-
B
glances
-
C
dstat
-
D
sar (System Activity Reporter)
✓ Correct
Explanation
sar collects historical system activity data and generates reports over time, making it ideal for capacity planning. dstat and glances provide real-time monitoring, and nmon is an interactive performance monitor without the historical reporting focus.
A user's home directory is full, but du shows less space than df reports as used. What is the most likely explanation?
-
A
The filesystem has excessive fragmentation
-
B
There are deleted but still-open files being held by processes
✓ Correct
-
C
The user has many hard links consuming duplicate space
-
D
SELinux is hiding certain files from du output
Explanation
Deleted files that are still open by running processes consume space on disk but aren't counted by du. Hard links don't duplicate space, fragmentation doesn't affect usage reports, and SELinux doesn't hide files from du.
You want to create a compressed archive of a directory while preserving symbolic links as links rather than following them. Which tar option should you use?
-
A
tar -czf archive.tar.gz --follow-symlinks directory/
-
B
tar -czf archive.tar.gz --no-recursion directory/
-
C
tar -czf archive.tar.gz -h directory/
-
D
tar -czf archive.tar.gz -P directory/
✓ Correct
Explanation
The -P (or --absolute-names) option preserves symbolic links as links. The -h option follows symlinks and includes content, --follow-symlinks also expands symlinks, and --no-recursion prevents directory traversal.
When configuring sudo, you want to allow a specific user to run only backup commands without requiring a password. Where should this configuration be placed?
-
A
/etc/sudoers or files in /etc/sudoers.d/
✓ Correct
-
B
/etc/security/limits.conf
-
C
/root/.bashrc
-
D
/home/username/.sudo_config
Explanation
sudo rules are configured in /etc/sudoers or in files within /etc/sudoers.d/ directory. .bashrc is for shell configuration, limits.conf controls resource limits, and .sudo_config is not a valid sudo configuration file.
You are analyzing a core dump file from a crashed application for debugging purposes. Which tool allows you to inspect and debug the core dump interactively?
-
A
strings corefile | grep error
-
B
hexdump -C corefile
-
C
objdump -d corefile
-
D
gdb (GNU Debugger) with the core dump file
✓ Correct
Explanation
gdb can load and analyze core dumps interactively, providing stack traces and variable inspection. objdump, strings, and hexdump provide limited information without full debugging capabilities.
A cron job is not executing as expected. You've verified the cron syntax is correct and the script has proper permissions. What should you check next to diagnose the issue?
-
A
Check if the cron daemon is running and enabled at boot
-
B
All of the above
✓ Correct
-
C
Examine the cron log files for error messages
-
D
Verify the /etc/cron.allow and /etc/cron.deny files permit the user
Explanation
Comprehensive cron troubleshooting requires checking access controls, daemon status, and log files. All three steps are necessary to fully diagnose cron issues.
You need to configure a system to use a custom DNS server that should take precedence over DHCP-assigned servers. How should this be configured on a systemd system with networkd?
-
A
Edit the DHCP client configuration to ignore DNS assignments and use /etc/hosts instead
-
B
Modify /etc/systemd/resolved.conf with DNS= and FallbackDNS= options, then restart systemd-resolved
✓ Correct
-
C
Use nmcli to set the DNS server in the network connection profile
-
D
Edit /etc/resolv.conf and add the nameserver, then run resolvectl flush-caches
Explanation
On systemd systems, custom DNS is configured in /etc/systemd/resolved.conf with DNS= taking precedence. Direct /etc/resolv.conf editing is overwritten by systemd, nmcli is for NetworkManager, and ignoring DHCP DNS isn't a proper solution.
When setting up log rotation with logrotate, you want to ensure that application-specific logs are rotated daily and old logs are kept for 30 days. Which configuration options should be used?
-
A
daily, rotate 30, size 10M
-
B
hourly, retain 30, create
-
C
daily, rotate 30, compress
✓ Correct
-
D
daily, maxage 30, missingok
Explanation
The 'daily' option rotates logs daily, 'rotate 30' keeps 30 rotated copies, and 'compress' saves space. The 'size' option is for size-based rotation (not time-based), maxage is for removing old files by age, and hourly isn't standard daily rotation.
You've deployed an application that requires access to hardware devices. The application runs as an unprivileged user but needs to access /dev/ttyUSB0. What is the most secure way to grant this access?
-
A
Use setuid on the application binary
-
B
Run the application as root
-
C
Change /dev/ttyUSB0 permissions to 666 for world access
-
D
Add the user to the group that owns the device, or use udev rules to adjust ownership/permissions
✓ Correct
Explanation
Adding the user to the device's group or using udev rules provides secure, granular access control. Running as root, world-readable devices, and setuid binaries all introduce unnecessary security risks.
A system is experiencing intermittent network connectivity issues. Which command provides real-time statistics about network interface errors and dropped packets?
-
A
ifconfig -a
-
B
netstat -i
✓ Correct
-
C
ethtool -S eth0
-
D
ip link show
Explanation
netstat -i displays interface statistics including error counts and dropped packets. ip link and ifconfig show interface status but limited error details, while ethtool -S provides driver-specific statistics that may vary.
When implementing a Linux container strategy, you want to ensure that containers can be started and managed by non-root users securely. Which technology and configuration should be employed?
-
A
Enable rootless containers and configure user namespaces appropriately
✓ Correct
-
B
Add unprivileged users to the docker or podman group
-
C
Use suid binaries for container runtime tools with restricted capabilities
-
D
Configure sudoers to allow container commands without password prompts
Explanation
Rootless containers with proper user namespace configuration provide secure non-root container management. Adding users to the docker/podman group grants privileges equivalent to root, sudo without passwords is insecure, and suid binaries are a legacy approach.
You need to verify that a service is properly configured to start automatically at boot in a systemd system. Which command provides this information?
-
A
systemctl show servicename --property=Enabled
-
B
systemctl is-enabled servicename
✓ Correct
-
C
systemctl status servicename
-
D
systemctl list-unit-files | grep servicename
Explanation
systemctl is-enabled checks if a service is enabled for automatic startup. status shows current state, list-unit-files shows all services, and show with Enabled property may not display the same format on all systems.
You are implementing file-level encryption for sensitive data on a Linux system. Which approach provides transparent encryption at the filesystem level?
-
A
Use application-level encryption within the database software
-
B
Use eCryptfs or fscrypt for transparent per-file or filesystem encryption
✓ Correct
-
C
Encrypt individual files using openssl before storage
-
D
Enable LUKS encryption only at the partition level and accept performance overhead
Explanation
eCryptfs and fscrypt provide transparent filesystem-level encryption that's automatic and performant. Manual openssl encryption isn't transparent, LUKS is volume-level not file-level, and application-level encryption is not filesystem-level transparency.
A user accidentally deleted important files from their home directory. These files were not backed up separately. If the filesystem has available space and deletions just occurred, which approach offers the best recovery chance?
-
A
Use fsck to repair the filesystem and recover deleted files
-
B
Restore from a backup (if available) or contact a data recovery service
-
C
Use dd to image the partition and analyze with a hex editor
-
D
Use recovery tools like extundelete or testdisk that search for recoverable file data
✓ Correct
Explanation
Tools like extundelete and testdisk search for recoverable deleted file data on the filesystem. fsck is for filesystem consistency, not recovery. Backups and professional recovery are alternatives, but the question implies no backup exists.
You're configuring a system to use both IPv4 and IPv6 addresses on a single interface. Which approach ensures both protocols function simultaneously without conflicts?
-
A
Use DHCP for IPv4 and stateless address autoconfiguration (SLAAC) for IPv6 on the same interface
-
B
Configure IPv6 in /etc/network/interfaces or netplan alongside IPv4, ensuring proper address syntax and gateway configuration for each protocol
✓ Correct
-
C
Assign one protocol to the primary interface and the other to a virtual alias
-
D
Run separate network stacks on different CPU cores using cpuset
Explanation
Dual-stack IPv4/IPv6 is configured in network configuration files with separate address specifications. Option B is one method but not the only one, aliasing separates protocols unnecessarily, and CPU management doesn't apply to network protocols.
When analyzing system security, you want to identify all listening network ports and the processes associated with them. Which command provides comprehensive output for this task?
-
A
iptables -L -n
-
B
netstat -tlnp or ss -tlnp
✓ Correct
-
C
lsof -i :* without filters
-
D
nmap localhost
Explanation
netstat -tlnp or ss -tlnp shows listening TCP/UDP ports with associated process information. nmap performs external scanning, lsof requires careful filtering, and iptables shows firewall rules, not listening ports.
Which command is used to display the current working directory in Linux?
-
A
pwd
✓ Correct
-
B
ls
-
C
cd
-
D
dir
Explanation
The pwd command prints the working directory path to standard output. The cd command changes directories, ls lists files, and dir is not a standard Linux command.
What is the purpose of the umask command?
-
A
It encrypts files using a mask-based algorithm.
-
B
It sets the default file creation mode mask for new files and directories.
✓ Correct
-
C
It removes file permissions from all users.
-
D
It displays all masked processes running in the background.
Explanation
The umask command sets a mask that determines which permissions are NOT given to newly created files and directories. It affects the default permissions assigned during file creation.
Which of the following best describes the purpose of the /etc/sudoers file?
-
A
It stores the configuration settings for the sudo daemon service running in the background.
-
B
It defines which users and groups can execute commands with elevated privileges through sudo.
✓ Correct
-
C
It logs all sudo command executions for security auditing and compliance purposes.
-
D
It contains a list of system users and their encrypted passwords for authentication.
Explanation
The /etc/sudoers file specifies which users and groups have permission to run commands with sudo (elevated privileges) and under what conditions. It is managed with the visudo command to prevent syntax errors.
What does the sticky bit do when applied to a directory?
-
A
It makes all files within the directory executable by default.
-
B
It prevents the directory from being deleted by any user except the owner or root.
-
C
It restricts file deletion within the directory to only the file owner or root, even if others have write permissions.
✓ Correct
-
D
It automatically archives the directory contents at regular intervals.
Explanation
The sticky bit on a directory ensures that only the file owner, directory owner, or root can delete or rename files within it, preventing accidental or malicious deletion by other users with write access. This is commonly used on directories like /tmp.
Which command would you use to search for files modified within the last 7 days?
-
A
grep -r 'modified' /
-
B
search --days 7 /
-
C
find / -mtime -7
✓ Correct
-
D
locate -time 7
Explanation
The find command with -mtime -7 searches for files modified less than 7 days ago. The negative sign means 'less than', while a positive value would mean 'more than' or 'exactly' that many days.
What is the primary purpose of the chroot command?
-
A
It changes the ownership of a file to a different user or group.
-
B
It establishes a new root directory context, isolating a process from the main filesystem.
✓ Correct
-
C
It modifies the file access rights for all files in a directory.
-
D
It checks for corrupted files and repairs them automatically.
Explanation
The chroot command changes the root directory for a process and its children, creating an isolated filesystem environment. This is useful for security, testing, and running applications in confined spaces.
Which file contains the mapping of IP addresses to hostnames on a local system?
-
A
/etc/hosts
✓ Correct
-
B
/etc/resolv.conf
-
C
/etc/hostname
-
D
/etc/network/interfaces
Explanation
The /etc/hosts file contains static mappings of IP addresses to hostnames that the system checks before querying DNS. The /etc/hostname file contains only the system's hostname, while /etc/resolv.conf specifies DNS servers.
When configuring a network interface with a static IP address, which file would you typically edit in a systemd-based distribution?
-
A
/etc/sysconfig/network-scripts/ifcfg-*
-
B
/etc/netplan/*.yaml
✓ Correct
-
C
/etc/hostname
-
D
/etc/network/interfaces
Explanation
Modern systemd-based distributions like Ubuntu use netplan for network configuration, with YAML files stored in /etc/netplan/. The first option is Debian-based non-systemd systems, and the third is for older Red Hat-based systems.
What is the purpose of the /proc filesystem?
-
A
It archives log files and system activity for historical analysis.
-
B
It contains the binary executables for all system processes.
-
C
It is a virtual filesystem providing information about running processes and kernel parameters.
✓ Correct
-
D
It stores permanent configuration files for all system services.
Explanation
The /proc filesystem is a virtual filesystem that provides dynamic information about running processes, kernel statistics, and system configuration via special files. It exists only in memory and is not stored on disk.
Which command would you use to monitor real-time system resource usage, including CPU and memory?
-
A
vmstat
-
B
top
✓ Correct
-
C
netstat
-
D
iotop
Explanation
The top command provides a real-time, interactive view of system resource usage including CPU, memory, and processes. vmstat shows memory statistics, iotop shows disk I/O, and netstat shows network connections.
What does the -R option do when used with the chmod command?
-
A
It reverts the file to its original default permissions.
-
B
It applies permission changes recursively to directories and their contents.
✓ Correct
-
C
It removes all permissions from the specified file.
-
D
It restricts the file from being read by regular users.
Explanation
The -R (recursive) option with chmod applies the specified permission changes to a directory and all its contents, including subdirectories and files. This is useful for batch permission modifications.
Which systemd unit type is responsible for managing system mount points?
-
A
Mount units
✓ Correct
-
B
Service units
-
C
Socket units
-
D
Timer units
Explanation
Mount units (*.mount files) manage filesystem mount points in systemd, replacing traditional /etc/fstab entries. Service units manage daemons, socket units handle socket activation, and timer units schedule tasks.
What is the purpose of the journalctl command?
-
A
It compresses old journal files to save disk space on the system.
-
B
It monitors journal file sizes and performs automatic rotation.
-
C
It creates journal backups and archives them for long-term storage.
-
D
It queries and displays logs from the systemd journal.
✓ Correct
Explanation
The journalctl command is used to query and view logs collected by the systemd journal service. It can filter logs by time, priority, unit, and other criteria, replacing traditional text-based log file viewing.
How would you view the contents of a compressed tar archive without extracting it?
-
A
tar -vzf archive.tar.gz
-
B
tar -czf archive.tar.gz
-
C
tar -xzf archive.tar.gz
-
D
tar -tzf archive.tar.gz
✓ Correct
Explanation
The tar -tzf command lists (t) the contents of a compressed gzip (z) tar file (f) without extracting. The -x flag extracts, -c creates, and -v shows verbose output.
Which of the following best describes the purpose of the /etc/fstab file?
-
A
It contains the list of currently mounted filesystems that are active in memory.
-
B
It stores the fast startup tab configuration for reducing boot time.
-
C
It defines which filesystems should be automatically mounted at system startup.
✓ Correct
-
D
It records the history of all filesystem checks performed by the fsck utility.
Explanation
The /etc/fstab (filesystem table) file defines static filesystem configuration, specifying which filesystems to mount at boot time, including mount points, filesystem types, and options. Modern systemd systems can also use /etc/fstab.
What is the significance of the SUID (Set User ID) bit when applied to an executable file?
-
A
It allows the file to be executed only by the owner of the file.
-
B
It causes the file to execute with the privileges of the file owner rather than the user executing it.
✓ Correct
-
C
It enables the file to bypass standard authentication and access control mechanisms entirely.
-
D
It prevents the file from being executed by any user except the system administrator.
Explanation
The SUID bit causes an executable to run with the permissions of its owner, not the user executing it. This is commonly used for programs like passwd that need elevated privileges but shouldn't grant full root access.
Which command is used to view the current DNS resolver configuration on a Linux system?
-
A
cat /etc/resolv.conf
-
B
Both A and B are correct depending on the system configuration.
✓ Correct
-
C
nslookup localhost
-
D
systemd-resolve --status
Explanation
On traditional systems, /etc/resolv.conf contains DNS configuration, while modern systemd systems use systemd-resolve for DNS resolution. Both commands can be used depending on the system's configuration.
What does the lsof command primarily display?
-
A
The open files and file descriptors associated with running processes.
✓ Correct
-
B
The filesystem table showing which filesystems are mounted and available.
-
C
A list of all lost files that have been deleted but not yet overwritten.
-
D
A sorted list of files ordered by their size in descending order.
Explanation
The lsof command (list open files) displays all files and network connections currently open by running processes. This is useful for troubleshooting, finding which processes have locked files, and security analysis.
When setting up a cron job, what does the asterisk (*) in the minute field represent?
-
A
It means the job executes only at midnight.
-
B
It means the job will never execute; the field is disabled.
-
C
It represents every minute of every hour.
✓ Correct
-
D
It indicates that the system should use the default timing interval.
Explanation
In cron syntax, an asterisk (*) in any field means 'every' value for that field. An asterisk in the minute field means the job runs every minute of every hour it is otherwise scheduled.
Which of the following is the correct way to set an environment variable in a login shell?
-
A
variable VAR_NAME=value
-
B
export VAR_NAME=value
✓ Correct
-
C
set VAR_NAME=value
-
D
env VAR_NAME=value
Explanation
The export command sets an environment variable that is inherited by child processes. The env command runs another command with modified environment variables but does not persist them in the current shell.
What is the primary role of the Linux kernel's inode structure?
-
A
It stores the actual contents of files and directories on the disk.
-
B
It encrypts and compresses file data to optimize storage usage.
-
C
It contains metadata about files such as permissions, ownership, size, and timestamps.
✓ Correct
-
D
It manages the physical layout of data blocks on the storage device.
Explanation
An inode is a data structure that stores metadata about a file or directory, including permissions, ownership, modification times, and pointers to data blocks. The inode does not store the actual file contents.
Which command would you use to display the amount of disk space used by a specific directory and its contents?
-
A
df -h /path/to/directory
-
B
stat /path/to/directory
-
C
du -sh /path/to/directory
✓ Correct
-
D
ls -lh /path/to/directory
Explanation
The du -sh command shows the disk usage (du) of a directory (-s for summary, -h for human-readable). The df command shows filesystem usage, ls shows file listings, and stat shows file metadata.
What is the purpose of the /etc/shadow file?
-
A
It manages shadow filesystems that are used for redundancy and fault tolerance.
-
B
It contains backup copies of critical system configuration files for disaster recovery.
-
C
It stores encrypted password hashes and password aging information for user accounts.
✓ Correct
-
D
It provides a shadowing mechanism to hide sensitive processes from monitoring tools.
Explanation
The /etc/shadow file stores encrypted password hashes and password policy information (expiration, minimum age, etc.) and is readable only by root, providing enhanced security compared to /etc/passwd.
Which of the following best describes the role of the /etc/default directory?
-
A
It serves as the default location where all users' home directories are created.
-
B
It holds temporary default files created during system installation and boot processes.
-
C
It stores default configuration parameters and environment variables for system services and utilities.
✓ Correct
-
D
It contains the default system applications that users cannot modify or delete.
Explanation
The /etc/default directory contains configuration files that set default parameters, environment variables, and options for various system services and utilities (e.g., /etc/default/grub for GRUB bootloader settings).
When examining process priorities with the nice and renice commands, what does a lower nice value indicate?
-
A
The process has higher priority for CPU scheduling and will receive more processor time.
✓ Correct
-
B
The process has a lower priority for I/O operations but higher priority for CPU usage.
-
C
The process has lower memory requirements and uses less RAM.
-
D
The process is more likely to be suspended or moved to the background by the scheduler.
Explanation
In Linux, lower nice values (ranging from -20 to 19) indicate higher priority for CPU scheduling. A process with nice value -10 will receive more CPU time than a process with nice value +10.
A system administrator needs to configure a network interface to use a static IP address of 192.168.1.100/24 with gateway 192.168.1.1. Which file should be edited on a Red Hat-based system?
-
A
/etc/sysconfig/network-scripts/ifcfg-eth0
✓ Correct
-
B
/etc/network/interfaces
-
C
/etc/NetworkManager/conf.d/99-static.conf
-
D
/etc/resolv.conf
Explanation
On Red Hat-based systems, network interface configurations are stored in /etc/sysconfig/network-scripts/. The file naming convention is ifcfg-<interface-name>, where the administrator can define IP, gateway, and other network settings.
Which command is used to display the current runlevel of a Linux system?
-
A
init -q
-
B
chkconfig --list
-
C
systemctl status
-
D
runlevel
✓ Correct
Explanation
The 'runlevel' command displays both the previous and current runlevel of the system. In systemd systems, this can also be checked with 'systemctl get-default', but 'runlevel' remains a standard utility.
A Linux administrator wants to ensure that a script runs every day at 2:30 AM. The script should not run if the system was powered down at that time. Which scheduling method is most appropriate?
-
A
cron
✓ Correct
-
B
anacron
-
C
systemd timer with persistent=true
-
D
at daemon
Explanation
Standard cron is appropriate for recurring daily tasks at specific times when the system is expected to be running. While anacron handles missed jobs on systems that power down, cron is the standard choice for reliable daily scheduling on always-on systems.
An administrator is troubleshooting a service that fails to start. The systemd service file contains 'Type=forking'. What does this configuration indicate?
-
A
Multiple instances of the same service can run simultaneously without conflict
-
B
The service spawns a child process and the parent exits; systemd tracks the child
✓ Correct
-
C
The service will always fork into background and cannot be controlled by systemd
-
D
The service requires the fork() syscall to be available on the system
Explanation
Type=forking tells systemd that the service will spawn a child process and exit the parent. Systemd monitors the remaining child process. This is common for traditional daemon-style services that daemonize themselves.
Which of the following best describes the purpose of the umask value?
-
A
It prevents users from modifying file permissions using chmod
-
B
It encrypts file permissions to prevent unauthorized access
-
C
It defines the default permissions subtracted from the maximum permissions when files or directories are created
✓ Correct
-
D
It masks system calls that are dangerous and prevents their execution
Explanation
The umask is a bitmask that defines which permission bits are turned OFF by default when new files or directories are created. For example, a umask of 0022 removes write permissions for group and others.
A user reports that they cannot read a file with permissions -rw-r-----. They are the file owner and belong to the correct group. What is the most likely reason?
-
A
The parent directory lacks execute permission for the user
✓ Correct
-
B
The file has been locked by the system administrator
-
C
SELinux context is preventing access despite traditional permissions
-
D
The user's umask is interfering with their ability to read
Explanation
Even with read permissions on the file, a user must have execute (x) permission on the parent directory to access the file at all. Directory execute permission allows traversal, which is prerequisite for accessing any files within.
When configuring sudo, an administrator wants to allow a specific user to run only the /usr/bin/systemctl command without requiring a password. Which sudoers entry is correct?
-
A
user localhost=/usr/bin/systemctl (NOPASSWD)
-
B
%wheel ALL=(ALL) /usr/bin/systemctl
-
C
user ALL=NOPASSWD: /usr/bin/systemctl *
-
D
user ALL=(ALL) NOPASSWD: /usr/bin/systemctl
✓ Correct
Explanation
The correct sudoers syntax is 'user HOST=(RUNAS_USER) NOPASSWD: COMMAND'. This entry allows 'user' to run /usr/bin/systemctl on all hosts as any user without a password prompt.
An administrator observes that disk I/O performance is degrading. They check iostat and see high await times and low throughput. Which factor is most likely causing this issue?
-
A
Memory pressure is forcing excessive swap operations
-
B
The CPU is overloaded and cannot process I/O requests efficiently
-
C
The network interface is saturated with traffic
-
D
The storage device is experiencing high contention or physical limitations
✓ Correct
Explanation
High await times (average time I/O requests spend in queue) and low throughput indicate the storage device itself is the bottleneck, whether due to hardware limitations, high queue depth, or physical drive issues.
Which of the following correctly describes the relationship between inodes and filenames in a Linux filesystem?
-
A
Inodes store filenames and cannot exist without an associated filename in the filesystem
-
B
Filenames are stored in directory entries and point to inodes; multiple filenames can reference the same inode through hard links
✓ Correct
-
C
Filenames and inodes are synonymous terms for the same filesystem structure
-
D
Each filename must have a unique inode number; one inode cannot be referenced by multiple filenames
Explanation
Inodes contain file metadata (permissions, timestamps, data blocks). Directory entries map human-readable filenames to inode numbers. Multiple directory entries (hard links) can reference the same inode, but each has a different filename.
A system administrator wants to create a systemd service that should only start after the network has been fully configured. Which target should be added to the After= directive?
-
A
multi-user.target
-
B
network.target
-
C
network-online.target
✓ Correct
-
D
sys-subsystem-net-devices-*.device
Explanation
The network-online.target ensures the system waits until network connectivity is fully established and services are reachable, whereas network.target only indicates network interfaces are up. For services requiring actual connectivity, network-online.target is appropriate.