Docsity

TestOut Linux Pro Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
TestOut Linux Pro Ultimate Exam
**Question 1.** Which of the following best describes the Open Source philosophy?
A) Software must be free of charge.
B) Source code must be publicly available for modification and redistribution.
C) Only the original author may distribute the software.
D) Software cannot be used for commercial purposes.
Answer: B
Explanation: Open Source requires that the source code be accessible, allowing anyone to study, modify,
and share it, regardless of cost or commercial use.
**Question 2.** Which Linux distribution is directly derived from Red Hat Enterprise Linux and is aimed
at community users?
A) Debian
B) Ubuntu
C) CentOS Stream
D) openSUSE
Answer: C
Explanation: CentOS Stream tracks the development of RHEL and provides a free, community‑supported
build.
**Question 3.** In the Linux kernel architecture, which component runs in user space?
A) Device drivers
B) System call interface
C) Shells and applications
D) Scheduler
Answer: C
Explanation: Shells and user applications execute in user space, isolated from kernel space where core
OS functions run.
**Question 4.** During a manual installation, which command creates a 4 GiB swap partition on
/dev/sdb?
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

Partial preview of the text

Download TestOut Linux Pro Ultimate Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which of the following best describes the Open Source philosophy? A) Software must be free of charge. B) Source code must be publicly available for modification and redistribution. C) Only the original author may distribute the software. D) Software cannot be used for commercial purposes. Answer: B Explanation: Open Source requires that the source code be accessible, allowing anyone to study, modify, and share it, regardless of cost or commercial use. Question 2. Which Linux distribution is directly derived from Red Hat Enterprise Linux and is aimed at community users? A) Debian B) Ubuntu C) CentOS Stream D) openSUSE Answer: C Explanation: CentOS Stream tracks the development of RHEL and provides a free, community‑supported build. Question 3. In the Linux kernel architecture, which component runs in user space? A) Device drivers B) System call interface C) Shells and applications D) Scheduler Answer: C Explanation: Shells and user applications execute in user space, isolated from kernel space where core OS functions run. Question 4. During a manual installation, which command creates a 4 GiB swap partition on /dev/sdb?

A) mkswap /dev/sdb1 after partitioning the device to 4 GiB. B) dd if=/dev/zero of=/dev/sdb bs=1M count=4096 C) mkfs.ext4 /dev/sdb1 D) fdisk /dev/sdb and select “swap” type. Answer: A Explanation: After partitioning /dev/sdb1 to 4 GiB, mkswap initializes it as swap space. Question 5. Which bootloader configuration file is used by GRUB 2 to define menu entries? A) /boot/grub/menu.lst B) /etc/lilo.conf C) /boot/grub2/grub.cfg D) /etc/grub.d/00_header Answer: C Explanation: GRUB 2 reads compiled menu entries from /boot/grub2/grub.cfg. Question 6. Which command displays the current runlevel in a SysVinit system? A) systemctl get-default B) runlevel C) init 5 D) systemd-analyze Answer: B Explanation: The runlevel command prints the previous and current SysV runlevels. Question 7. Which systemd command sets the default target to graphical mode? A) systemctl set-default multi-user.target B) systemctl enable graphical.target C) systemctl set-default graphical.target D) systemctl isolate graphical.target Answer: C

A) HOME

B) PATH

C) SHELL

D) LD_LIBRARY_PATH

Answer: B Explanation: PATH contains colon‑separated directories that the shell scans for commands. Question 12. How can you permanently create an alias ll for ls - l - a in Bash? A) Add alias ll='ls - l - a' to /etc/profile. B) Run alias ll='ls - l - a' at the command line. C) Place alias ll='ls - l - a' in ~/.bashrc. D) Use set alias ll='ls - l - a'. Answer: C Explanation: Adding the alias to ~/.bashrc ensures it loads for each interactive Bash session. Question 13. Which command extracts lines containing the word “error” from a log file, ignoring case? A) grep - i error logfile B) sed /error/ logfile C) awk '/error/ {print}' logfile D) cut - d error logfile Answer: A Explanation: grep - i performs a case‑insensitive search for “error”. Question 14. Which sed command replaces the first occurrence of “foo” with “bar” on each line of a file? A) sed 's/foo/bar/' file B) sed 's/foo/bar/g' file C) sed '/foo/s//bar/' file

D) sed - e 's/foo/bar/1' file Answer: A Explanation: Without the g flag, sed substitutes only the first match per line. Question 15. Which awk script prints the third field of each line, assuming fields are space‑delimited? A) awk '{print $3}' file B) awk '{printf $3}' file C) awk - F: '{print $3}' file D) awk '{print $[3]}' file Answer: A Explanation: $3 references the third field; default field separator is whitespace. Question 16. What does the following pipeline do? ps aux | grep httpd | awk '{print $2}' A) Lists all processes named “httpd”. B) Shows the command line of the httpd service. C) Prints the PID of each httpd process. D) Restarts the httpd service. Answer: C Explanation: ps aux lists processes, grep httpd filters httpd entries, and awk '{print $2}' outputs the second column, which is the PID. Question 17. Which redirection operator appends output to an existing file? A) > B) >> C) | D) 2> Answer: B Explanation: >> adds output to the end of a file without overwriting it.

A) /etc/fstab B) /etc/mtab C) /proc/mounts D) /etc/rc.local Answer: A Explanation: /etc/fstab defines persistent mount points and options for system startup. Question 22. Which command displays the amount of free and used space on all mounted filesystems in a human‑readable format? A) df - h B) du - h C) lsblk - f D) fdisk - l Answer: A Explanation: df - h reports filesystem disk space usage with sizes in KiB/MiB/GiB. Question 23. How can you check the integrity of an ext4 filesystem on /dev/sdb1 without mounting it? A) fsck /dev/sdb1 B) e2fsck - n /dev/sdb1 C) mount - o ro /dev/sdb1 /mnt D) Both A and B are correct. Answer: D Explanation: fsck runs the appropriate checker; e2fsck - n performs a read‑only check on ext2/3/4. Question 24. Which command changes the permissions of a file so that the owner has read/write, the group has read, and others have no permissions? A) chmod 640 file B) chmod 600 file C) chmod 664 file

D) chmod 751 file Answer: A Explanation: Permission bits 6 (rw) for owner, 4 (r) for group, 0 for others correspond to octal 640. Question 25. Which chmod symbolic mode adds the sticky bit to a directory /tmp/share? A) chmod +t /tmp/share B) chmod 1777 /tmp/share C) chmod o+t /tmp/share D) Both A and C are correct. Answer: D Explanation: +t or o+t sets the sticky bit; both achieve the same result. Question 26. Which command changes the owner of /var/www/html to user www-data while preserving the current group? A) chown www-data /var/www/html B) chown www-data: /var/www/html C) chown :www-data /var/www/html D) chown www-data:www-data /var/www/html Answer: B Explanation: The syntax user: changes only the user, leaving the group unchanged. Question 27. How can you give the group devops execute permission on a directory without altering other permissions? A) chmod g+x /opt/project B) chmod 750 /opt/project C) chmod a+x /opt/project D) chmod +x /opt/project Answer: A Explanation: g+x adds execute permission only for the group.

B) lvcreate - l 2000 - n lv_data vg_main C) lvcreate - V 2G - n lv_data vg_main D) lvcreate - L 2G vg_main/lv_data Answer: A Explanation: -L 2G specifies size; -n names the LV; the VG is vg_main. Question 32. After creating a new logical volume /dev/vg_main/lv_data, which command formats it with XFS? A) mkfs.xfs /dev/vg_main/lv_data B) mkfs.ext4 /dev/vg_main/lv_data C) mkfs - t xfs /dev/vg_main/lv_data D) Both A and C are correct. Answer: D Explanation: Both mkfs.xfs and mkfs - t xfs produce an XFS filesystem. Question 33. Which RAID level provides striping with parity, allowing one disk failure without data loss? A) RAID 0 B) RAID 1 C) RAID 5 D) RAID 10 Answer: C Explanation: RAID 5 distributes parity across disks, tolerating a single drive failure. Question 34. Which command adds a physical volume on /dev/sdd1 for use with LVM? A) pvcreate /dev/sdd1 B) vgcreate /dev/sdd1 C) lvcreate /dev/sdd1 D) fdisk /dev/sdd1

Answer: A Explanation: pvcreate initializes a block device as an LVM physical volume. Question 35. In Systemd, which command lists all active units (services, sockets, timers, etc.)? A) systemctl list-units --type=service B) systemctl status C) systemctl list-units D) systemctl show Answer: C Explanation: systemctl list-units displays all loaded units, regardless of type. Question 36. Which command changes the default systemd target to multi‑user (non‑graphical) mode? A) systemctl set-default multi-user.target B) systemctl isolate multi-user.target C) systemctl enable multi-user.target D) systemctl start multi-user.target Answer: A Explanation: set-default writes the chosen target to /etc/systemd/system/default.target. Question 37. Which command shows the current working directory in the terminal? A) pwd B) whereami C) ls - d . D) echo $PWD Answer: A Explanation: pwd prints the absolute path of the current directory. Question 38. Which option with cp copies directories recursively?

D) cat syslog | head Answer: A Explanation: head defaults to showing the first ten lines. Question 42. Which option with grep prints the line numbers of matching lines? A) -n B) -c C) -l D) -v Answer: A Explanation: -n prefixes each matching line with its line number. Question 43. Which command displays the current processes owned by the user bob? A) ps - u bob B) top - u bob C) pgrep - u bob D) All of the above. Answer: D Explanation: All three list processes for user bob; ps - u prints a snapshot, top - u shows a live view, and pgrep - u returns PIDs. Question 44. Which command changes the nice value of a running process with PID 1234 to +10? A) renice +10 - p 1234 B) nice - n +10 - p 1234 C) kill - n +10 1234 D) renice 10 1234 Answer: A Explanation: renice adjusts the scheduling priority; +10 makes the process less favorable.

Question 45. Which command launches a background job that runs tar - czf backup.tgz /home? A) tar - czf backup.tgz /home & B) bg tar - czf backup.tgz /home C) nohup tar - czf backup.tgz /home D) Both A and C are correct. Answer: D Explanation: Appending & runs the command in the background; nohup detaches it from the terminal, also making it background‑friendly. Question 46. Which command terminates all processes named httpd? A) killall httpd B) pkill httpd C) kill - 9 $(pgrep httpd) D) All of the above. Answer: D Explanation: All three methods send termination signals to every httpd process. Question 47. Which file stores static DNS server entries for most Linux distributions that do not use systemd‑resolved? A) /etc/resolv.conf B) /etc/hosts C) /etc/dnsmasq.conf D) /etc/network/interfaces Answer: A Explanation: /etc/resolv.conf lists nameserver IPs for the resolver library. Question 48. Which command adds an IPv4 address 192.168.10.25/24 to interface eth0 using the ip utility? A) ip addr add 192.168.10.25/24 dev eth0 B) ifconfig eth0 192.168.10.25 netmask 255.255.255.0

Explanation: The --permanent flag writes the rule to the configuration; --add-service=ssh would also work but the question asks for a port specification. Question 52. Which configuration file contains the default SSH daemon settings on most Linux systems? A) /etc/ssh/sshd_config B) /etc/ssh/ssh_config C) /etc/ssh/sshd.conf D) /etc/ssh/ssh.conf Answer: A Explanation: sshd_config defines server‑side SSH daemon options. Question 53. Which SSH option disables password authentication in favor of key‑based login? A) PasswordAuthentication no B) PubkeyAuthentication yes C) PermitRootLogin no D) Both A and B are required. Answer: D Explanation: Disabling password auth (PasswordAuthentication no) and ensuring public‑key auth is enabled (PubkeyAuthentication yes) forces key‑based logins. Question 54. Which SELinux mode logs policy violations but does not enforce them? A) Enforcing B) Permissive C) Disabled D) Targeted Answer: B Explanation: In permissive mode, SELinux writes AVC denials to the log without blocking the actions.

Question 55. Which command displays the most recent entries from the system journal for the sshd service? A) journalctl - u sshd - r B) journalctl - u sshd --reverse C) journalctl - u sshd - n D) All of the above show recent entries. Answer: D Explanation: -r or --reverse lists entries newest first; -n shows the last few lines, all yielding recent logs. Question 56. Which package manager uses .deb files and the apt command suite? A) RPM B) DNF C) APT D) YUM Answer: C Explanation: Debian‑based systems use .deb packages managed by APT (apt-get, apt). Question 57. Which command installs the package htop on an Ubuntu system? A) apt install htop B) yum install htop C) dnf install htop D) zypper install htop Answer: A Explanation: apt is the default package manager on Ubuntu. Question 58. Which file stores repository definitions for DNF/YUM on Red Hat‑based systems? A) /etc/apt/sources.list B) /etc/yum.repos.d/*.repo

Explanation: modprobe resolves dependencies; insmod loads the specific file. Both succeed if dependencies are satisfied. Question 62. Which shell built‑in command displays the current shell’s version? A) echo $BASH_VERSION B) bash --version C) sh --version D) Both A and B are acceptable. Answer: D Explanation: $BASH_VERSION holds the version string; bash --version prints it directly. Question 63. Which of the following statements about cron is true? A) It can schedule tasks with a granularity of seconds. B) It reads user‑specific crontabs from /etc/cron.d. C) The system crontab is located at /etc/crontab. D) It only runs scripts owned by root. Answer: C Explanation: /etc/crontab is the system‑wide crontab; cron schedules with minute granularity. Question 64. Which command schedules a one‑time job to run /usr/local/bin/cleanup.sh at 02:30 AM tomorrow? A) at 02:30 tomorrow - f /usr/local/bin/cleanup.sh B) echo "/usr/local/bin/cleanup.sh" | at 02:30 tomorrow C) cron - e "30 2 * * * /usr/local/bin/cleanup.sh" D) Both A and B are correct. Answer: D Explanation: Both forms feed the command to at; the cron - e line is syntactically incorrect. Question 65. Which option with tar creates a compressed archive named archive.tar.gz from the directory /opt/data?

A) tar - czf archive.tar.gz /opt/data B) tar - cjf archive.tar.gz /opt/data C) tar - cf archive.tar.gz /opt/data D) tar - zcf archive.tar.gz /opt/data Answer: A Explanation: -c creates, -z filters through gzip, -f names the archive. Question 66. Which command displays the current memory usage in a human‑readable format? A) free - h B) top - b C) vmstat - s D) cat /proc/meminfo Answer: A Explanation: free - h summarizes RAM and swap usage with size units. Question 67. Which command lists all users currently logged into the system? A) who B) w C) users D) All of the above. Answer: D Explanation: All three commands provide information about logged‑in users, though w includes additional details. Question 68. Which file defines the default system locale settings? A) /etc/locale.conf B) /etc/default/locale C) /etc/environment D) /etc/sysconfig/i18n