




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. Which component of the Linux boot process is responsible for loading the kernel into memory? A) GRUB B) initramfs C) BIOS/UEFI D) systemd Answer: C Explanation: BIOS (or UEFI on modern systems) initializes hardware and loads the bootloader, which then loads the kernel. Question 2. In the Filesystem Hierarchy Standard, which directory contains configuration files for the system? A) /usr B) /var C) /etc D) /home Answer: C Explanation: /etc holds host‑specific system configuration files. Question 3. Which command displays the current runlevel under a systemd‑based distribution? A) runlevel B) systemctl list-units --type=target
C) who - r D) systemd-analyze dump Answer: B Explanation: systemd uses targets; listing them shows the active target (runlevel). Question 4. What does the “sticky bit” on a directory (e.g., /tmp) prevent? A) Deletion of files by non‑owners B) Execution of binaries by anyone C) Changing file permissions by group members D) Reading of files by others Answer: A Explanation: The sticky bit restricts deletion/renaming of files to the file’s owner, the directory’s owner, or root. Question 5. Which option to ls will display file permissions in symbolic form? A) - l B) - a C) - h D) - R Answer: A Explanation: ls - l shows long format including permission bits.
B) Sends output to /dev/null C) Executes the command with elevated privileges D) Appends output to a file Answer: A Explanation: & puts the preceding command in the background. Question 9. Which command creates a new user named “alice” with a home directory? A) useradd - m alice B) adduser alice C) useradd alice – create-home D) All of the above Answer: D Explanation: All listed commands (depending on distro) create a user with a home directory. Question 10. To add an existing user “bob” to the group “wheel”, which command is appropriate? A) usermod - a - G wheel bob B) groupadd wheel bob C) gpasswd - a bob wheel D) Both A and C
Answer: D Explanation: Both usermod - a - G and gpasswd - a add a user to a supplementary group. Question 11. Which file stores encrypted user passwords on most modern Linux systems? A) /etc/passwd B) /etc/shadow C) /etc/group D) /etc/login.defs Answer: B Explanation: /etc/shadow holds hashed passwords, while /etc/passwd contains user info. Question 12. What permission bits are set when a file has the SUID bit enabled? A) rwsr-xr-x B) rwxr-sr-x C) rwxrwxrwx D) rwxr-xr-x Answer: A Explanation: The SUID bit replaces the user execute bit with an “s”.
C) fdisk - t ext4 /dev/sdb D) mount - t ext4 /dev/sdb1 /mnt Answer: A Explanation: mkfs.ext4 creates an ext4 filesystem on the specified block device. Question 16. Which file contains static information about filesystems to be mounted at boot? A) /etc/fstab B) /etc/mtab C) /proc/mounts D) /etc/rc.local Answer: A Explanation: /etc/fstab lists filesystems and mount options for automatic mounting. Question 17. In LVM, what is the correct order of hierarchy from lowest to highest? A) VG → PV → LV B) LV → PV → VG C) PV → VG → LV D) PV → LV → VG Answer: C
Explanation: Physical Volumes (PV) are combined into Volume Groups (VG), from which Logical Volumes (LV) are created. Question 18. To extend a logical volume named “lv_data” by 10 GB, which command should be used? A) lvextend - L +10G /dev/vg0/lv_data B) lvresize - L +10G /dev/vg0/lv_data C) vgextend - L +10G /dev/vg0/lv_data D) Both A and B Answer: D Explanation: Both lvextend and lvresize can increase LV size; the syntax shown adds 10 GB. Question 19. Which command shows the amount of free and used space on all mounted filesystems? A) du - h B) df - h C) lsblk D) mount - l Answer: B Explanation: df - h reports disk space usage in human‑readable format.
C) Both A and B D) tar - cf backup.tar.gz /var/www | gzip Answer: C Explanation: Both -czf and -cvzf create a gzipped tarball; the latter includes verbose output. Question 23. Which rsync option preserves symbolic links, permissions, and timestamps? A) - a B) - r C) - p D) - t Answer: A Explanation: The -a (archive) flag combines recursion, preserving permissions, timestamps, symlinks, etc. Question 24. When a Linux system fails to boot and drops to an initramfs shell, what is the most likely cause? A) Corrupt GRUB configuration B) Missing root filesystem driver C) Incorrect /etc/fstab entry D) Failed network service Answer: B
Explanation: initramfs loads necessary drivers; failure often indicates the kernel cannot mount the root filesystem. Question 25. Which command displays the IP address and routing table for all interfaces? A) ifconfig - a B) ip addr show && ip route show C) netstat - r D) route - n Answer: B Explanation: ip addr show lists addresses; ip route show displays routing. Question 26. In CIDR notation, what does the suffix “/24” represent? A) 24 host bits B) 24 network bits C) Subnet mask 255.255.255. D) Both B and C Answer: D Explanation: /24 indicates a 24‑bit network prefix, equivalent to 255.255.255.0. Question 27. Which file is consulted first for DNS resolution on most Linux systems?
Answer: C Explanation: named.conf is the primary configuration where zone definitions reside. Question 30. In a DHCP server configuration, which directive assigns a fixed IP address to a specific MAC address? A) host B) fixed-address C) subnet D) range Answer: B Explanation: fixed-address inside a host block maps a MAC to a static IP. Question 31. Which SSH option disables password authentication, allowing only key‑based login? A) PasswordAuthentication no B) PubkeyAuthentication yes C) PermitRootLogin no D) AllowUsers no Answer: A Explanation: Setting PasswordAuthentication no forces key authentication.
Question 32. To copy a local directory to a remote server using SFTP, which command sequence is correct? A) sftp user@host:/remote/path B) put - r localdir /remote/path C) Both A and B (executed in order) D) scp - r localdir user@host:/remote/path Answer: C Explanation: First start sftp, then use put - r to transfer recursively. Question 33. Which tool can be used to test TCP connectivity to a specific port on a remote host? A) ping B) traceroute C) netcat (nc) D) nslookup Answer: C Explanation: nc can attempt a connection to a given host and port, useful for testing services. Question 34. Which iptables chain is consulted first for incoming packets destined for the local machine? A) OUTPUT B) INPUT
Explanation: In permissive mode, SELinux records denials without blocking actions. Question 37. To view the current SELinux context of a file named “script.sh”, which command is appropriate? A) ls - Z script.sh B) getsebool - a script.sh C) seinfo - c script.sh D) auditctl - l script.sh Answer: A Explanation: ls - Z displays SELinux security contexts. Question 38. Which log file typically contains authentication failures on most Linux distributions? A) /var/log/syslog B) /var/log/auth.log C) /var/log/kern.log D) /var/log/messages Answer: B Explanation: /var/log/auth.log records authentication events. Question 39. Which command installs the fail2ban package on a Debian‑based system?
A) yum install fail2ban B) dnf install fail2ban C) apt-get install fail2ban D) pacman - S fail2ban Answer: C Explanation: apt-get install is used on Debian/Ubuntu. Question 40. In a Bash script, which shebang line ensures the script runs with the system’s default Bash interpreter? A) #!/usr/bin/bash B) #!/bin/sh C) #!/usr/bin/env bash D) #!/bin/bash - e Answer: C Explanation: #!/usr/bin/env bash finds Bash via the environment’s PATH. Question 41. Which Bash built‑in command is used to exit a script with a specific status code? A) quit B) exit C) return D) break
A) Enables extended pattern matching B) Causes the script to exit on any command failure C) Prints each command before execution D) Disables filename expansion Answer: B Explanation: -e makes the shell exit immediately if a command exits with a non‑zero status. Question 45. Which command schedules a one‑time job to run at 02:30 AM tomorrow? A) cron "02:30 tomorrow" myscript.sh B) at 02:30 tomorrow C) batch 02:30 tomorrow D) systemctl start myscript.service --time 02: Answer: B Explanation: at schedules single execution jobs at a specified time. Question 46. To edit the crontab for the user “admin”, which command should be used? A) crontab - e - u admin B) crontab - u admin - e C) sudo crontab - e admin
D) Both A and B (order of options does not matter) Answer: D Explanation: crontab - u admin - e (or reversed) opens admin’s crontab for editing. Question 47. Which command shows a real‑time view of system processes with customizable columns? A) top B) ps aux C) htop D) vmstat Answer: C Explanation: htop provides an interactive, colored, real‑time process viewer. Question 48. To change the nice value of a running process with PID 1234 to - 5, which command is correct? A) renice - 5 1234 B) nice - n - 5 - p 1234 C) renice - 5 - p 1234 D) Both A and C Answer: D Explanation: Both renice - 5 1234 and renice - 5 - p 1234 set the priority.