Docsity

Certified Linux Administrator Practice Exam, Exams of Technology

Toggle sidebar
bg1
Certified Linux Administrator Practice Exam
**Question 1.** Which component of the boot process is responsible for loading the Linux
kernel into memory?
A) BIOS/UEFI
B) GRUB
C) initramfs
D) systemd
Answer: B
Explanation: GRUB (Grand Unified Bootloader) reads its configuration, loads the selected kernel
image and initramfs into memory, and then transfers control to the kernel.
**Question 2.** In a system using systemd, which target corresponds to the traditional runlevel
3 (multi‑user, no graphical interface)?
A) graphical.target
B) rescue.target
C) multi-user.target
D) emergency.target
Answer: C
Explanation: multi-user.target provides a full multi‑user environment without starting a
graphical display manager, matching the old runlevel 3.
**Question 3.** Which command displays the most recent entries from the systemd journal,
filtered by the “ssh” unit?
A) journalctl -u sshd.service --since "1 hour ago"
B) journalctl -b -u sshd.service
C) journalctl -u ssh.service -r
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60

Partial preview of the text

Download Certified Linux Administrator Practice Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which component of the boot process is responsible for loading the Linux kernel into memory? A) BIOS/UEFI B) GRUB C) initramfs D) systemd Answer: B Explanation: GRUB (Grand Unified Bootloader) reads its configuration, loads the selected kernel image and initramfs into memory, and then transfers control to the kernel. Question 2. In a system using systemd, which target corresponds to the traditional runlevel 3 (multi‑user, no graphical interface)? A) graphical.target B) rescue.target C) multi-user.target D) emergency.target Answer: C Explanation: multi-user.target provides a full multi‑user environment without starting a graphical display manager, matching the old runlevel 3. Question 3. Which command displays the most recent entries from the systemd journal, filtered by the “ssh” unit? A) journalctl - u sshd.service --since "1 hour ago" B) journalctl - b - u sshd.service C) journalctl - u ssh.service - r

D) journalctl - u sshd.service Answer: D Explanation: Using journalctl - u sshd.service shows all journal entries for the ssh daemon; adding -r would reverse order, but the basic request is satisfied by option D. Question 4. The file /var/log/kern.log primarily contains messages from which subsystem? A) User‑space applications B) Kernel C) Systemd services D) Cron daemon Answer: B Explanation: kern.log records messages generated by the kernel, such as hardware detection and driver events. Question 5. Which tool would you use to display detailed information about the CPU architecture, including flags and model name? A) lshw B) lscpu C) lsblk D) dmidecode Answer: B Explanation: lscpu prints CPU architecture details, including vendor, model, speed, and supported flags.

Answer: B Explanation: /proc/swaps lists active swap devices and their sizes; the swap size itself is defined when the swap partition or file is created, but /proc/swaps shows the current configuration. Question 9. Which command combines the output of ls - l with grep to list only regular files owned by user “alice”? A) ls - l | grep "^-" | grep alice B) ls - l - u alice C) find. - user alice - type f - exec ls - l {} ; D) ls - l | awk '/alice/ && $1 ~ /^-/ {print}' Answer: A Explanation: ls - l lists details; the first character “-” indicates a regular file. Piping through grep "^-" filters regular files, then grep alice selects those owned by alice. Question 10. In Bash, which construct creates a loop that iterates over the numbers 1 through 5? A) for i in {1..5}; do echo $i; done B) while i <=5; do echo $i; i=$((i+1)); done C) loop i 1 5; do echo $i; end D) foreach i (1 2 3 4 5) echo $i Answer: A Explanation: Bash’s brace expansion {1..5} generates the sequence, and the for loop iterates over it.

Question 11. Which of the following commands creates a hard link named “linkfile” to an existing file “original”? A) ln - s original linkfile B) ln original linkfile C) cp original linkfile D) mv original linkfile Answer: B Explanation: ln source linkname creates a hard link; the -s option would create a symbolic link. Question 12. What octal permission value gives the owner read/write/execute, the group read/execute, and others no permissions? A) 750 B) 755 C) 770 D) 711 Answer: A Explanation: Owner rwx = 7, group r-x = 5, others --- = 0 → 750. Question 13. Which special permission bit allows users to execute a program with the privileges of the file’s owner? A) Sticky bit B) Setgid C) Setuid D) ACL

A) /etc/sudoers B) /etc/passwd C) /etc/group D) /etc/security/limits.conf Answer: A Explanation: The sudoers file defines sudo privileges; adding NOPASSWD: for a user allows password‑less sudo. Question 17. Which command sets an Access Control List granting user “charlie” read permission on file “report.txt”? A) setfacl - m u:charlie:r report.txt B) chmod u+r report.txt C) chown charlie report.txt D) setfacl - x u:charlie report.txt Answer: A Explanation: setfacl - m u:charlie:r modifies the ACL to give user charlie read access. Question 18. In SELinux, which mode logs policy violations but does not enforce them? A) enforcing B) permissive C) disabled D) targeted Answer: B

Explanation: Permissive mode records denials in audit logs while allowing the actions to proceed. Question 19. Which command creates a new physical volume on the partition /dev/sdb for LVM use? A) pvcreate /dev/sdb B) vgcreate vg01 /dev/sdb C) lvcreate - n lv01 - L 10G vg D) mkfs.ext4 /dev/sdb Answer: A Explanation: pvcreate initializes a block device as an LVM physical volume. Question 20. To extend a logical volume “lv_data” by 5 GB while it is mounted, which sequence is correct? A) lvextend - L +5G /dev/vg0/lv_data; resize2fs /dev/vg0/lv_data B) lvextend - L 5G /dev/vg0/lv_data; e2fsck - f /dev/vg0/lv_data C) vgextend vg0 /dev/sdc1; lvextend - l +100%FREE /dev/vg0/lv_data D) lvresize - L +5G /dev/vg0/lv_data; mount - o remount /mountpoint Answer: A Explanation: lvextend grows the LV; for ext4 filesystems, resize2fs can enlarge the filesystem while it is online. Question 21. Which command creates an XFS filesystem on the device /dev/sdx2? A) mkfs.xfs /dev/sdx B) mkfs.ext4 /dev/sdx

Question 24. To enforce a quota of 2 GB per user on the /home filesystem, which steps are required? (Select the best single answer) A) mount - o usrquota /home; quotacheck - cug /home; quotaon /home B) edit /etc/fstab to add usrquota, run quotacheck, then quotaon C) setfacl - m quota=2G /home/* D) ulimit - v 2097152 Answer: B Explanation: Adding the usrquota option in /etc/fstab, then running quotacheck - cug to create quota files, and finally enabling quotas with quotaon is the correct procedure. Question 25. Which command assigns a static IPv4 address 192.168.10.25/24 to interface eth0 using the ip utility? A) ip addr add 192.168.10.25/24 dev eth B) ifconfig eth0 192.168.10.25 netmask 255.255.255.0 up C) nmcli con mod eth0 ipv4.addresses 192.168.10.25/ D) dhclient eth0 192.168.10. Answer: A Explanation: ip addr add directly configures an address on an interface; the other options use different tools. Question 26. Which file typically contains the system’s DNS resolver configuration? A) /etc/hosts B) /etc/resolv.conf C) /etc/named.conf D) /etc/dhcp/dhclient.conf

Answer: B Explanation: /etc/resolv.conf lists nameserver IP addresses used by the resolver library. Question 27. To capture live network packets on interface eth1 and save them to capture.pcap, which command is appropriate? A) tcpdump - i eth1 - w capture.pcap B) netstat - i eth1 - o capture.pcap C) ss - i eth1 - w capture.pcap D) iptables - A INPUT - j LOG --log-prefix "CAP" Answer: A Explanation: tcpdump - i eth1 - w file records raw packets to a pcap file. Question 28. Which firewalld zone provides the most restrictive default policy? A) public B) internal C) drop D) trusted Answer: C Explanation: The drop zone silently drops incoming packets without replying, making it the most restrictive. Question 29. In iptables, which chain is consulted first for packets destined for the local machine? A) INPUT

Explanation: sshd_config contains daemon settings, including the Port directive. Question 32. Which command installs the Apache HTTP server on a Debian‑based system? A) yum install httpd B) dnf install apache C) apt-get install apache D) zypper install apache Answer: C Explanation: Debian and Ubuntu use apt/apt-get; the package name for Apache is apache2. Question 33. In an Nginx server block, which directive defines the directory that contains the website’s files? A) root B) document_root C) web_root D) alias Answer: A Explanation: The root directive sets the base directory for requests within a server block. Question 34. Which NTP daemon is the default on most modern Red Hat Enterprise Linux releases? A) ntpd B) chronyd C) timesyncd D) timed

Answer: B Explanation: chronyd replaces the older ntpd as the default time synchronization service in RHEL 7+. Question 35. Which command updates the package index on a Debian system without installing any packages? A) apt-get upgrade B) apt-get update C) apt-get dist-upgrade D) apt-get install Answer: B Explanation: apt-get update refreshes the local package database from remote repositories. Question 36. To add the EPEL repository on a CentOS 8 system, which command is used? A) yum install epel-release B) dnf install epel-release C) rpm - Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm D) yum-config-manager --add-repo epel Answer: C Explanation: Adding the EPEL repo on newer CentOS versions typically uses an RPM package from Fedora’s site. Question 37. Which command shows detailed information about the installed package “vim” using rpm?

Answer: A Explanation: Package managers retrieve pre‑built binaries and handle dependencies, whereas compiling from source builds the software locally. Question 40. Which command creates a compressed tar archive named backup.tar.gz containing the directory /etc? A) tar - czf backup.tar.gz /etc B) tar - cvf backup.tar.gz /etc C) gzip - c /etc > backup.tar.gz D) zip - r backup.tar.gz /etc Answer: A Explanation: tar - czf creates a gzip‑compressed archive of the specified directory. Question 41. To synchronize the directory /var/www from a remote host 192.168.1.10 to the local machine, preserving permissions, which rsync option is essential? A) - a B) - r C) - v D) - u Answer: A Explanation: The -a (archive) option preserves permissions, timestamps, symbolic links, and recurses into directories. Question 42. Which command schedules a one‑time job to run at 02:30 AM tomorrow? A) at 02:30 tomorrow

B) cron 02:30 tomorrow C) schedule run 02:30 tomorrow D) batch 02:30 tomorrow Answer: A Explanation: The at command accepts a time specification and schedules a single execution. Question 43. In a Bash script, which construct correctly tests whether variable $count is greater than 10? A) if [ $count - gt 10 ]; then … fi B) if ($count > 10) then … fi C) if test $count > 10; then … fi D) if [[ $count > 10 ]]; then … fi Answer: A Explanation: [ ] with -gt performs integer comparison; [[ ]] also works but requires -gt for numeric comparison. Question 44. Which Git command creates a new branch named “feature” and switches to it in a single step? A) git branch feature && git checkout feature B) git checkout - b feature C) git switch feature D) git new-branch feature Answer: B Explanation: git checkout - b both creates and checks out the new branch.

Answer: A Explanation: lsmod reads /proc/modules and displays loaded modules. Question 48. Which of the following tools can be used to analyze memory usage per process in a hierarchical view? A) top B) htop C) smem D) vmstat Answer: C Explanation: smem provides proportional set size (PSS) and a tree view of memory consumption per process. Question 49. In systemd, which command reloads unit files after editing a service’s configuration without restarting the service? A) systemctl daemon-reload B) systemctl reload service_name C) systemctl restart service_name D) systemctl enable service_name Answer: A Explanation: daemon-reload forces systemd to re‑read unit files; the service itself may need a separate reload.

Question 50. To permanently set the kernel parameter net.ipv4.ip_forward to 1, which file should be edited? A) /etc/sysctl.conf B) /etc/modprobe.d/ipv4.conf C) /proc/sys/net/ipv4/ip_forward D) /etc/network/interfaces Answer: A Explanation: Adding net.ipv4.ip_forward=1 to /etc/sysctl.conf makes the setting persist across reboots; sysctl - w changes it only temporarily. Question 51. Which command displays the current runlevel (or systemd target) of the system? A) runlevel B) systemctl get-default C) who - r D) uptime Answer: A Explanation: runlevel prints the previous and current runlevels; on systemd it maps to the corresponding target. Question 52. Which option for the mount command makes the mount read‑only? A) - o ro B) - r C) - o read-only D) - t ro