Docsity

The TestOut Linux Pro Practice Exam, Exams of Technology

Toggle sidebar
bg1
The TestOut Linux Pro Practice Exam
**Question 1. Which component of a Linux system is responsible for managing hardware
resources and providing system calls to user-space programs?**
A) Bash shell
B) Init system
C) Linux kernel
D) GNU C Library
Answer: C
Explanation: The kernel is the core of Linux; it controls hardware, memory, processes, and offers
system calls.
**Question 2. Which of the following distributions is most commonly used for server
environments and is based on Red Hat Enterprise Linux?**
A) Ubuntu
B) Fedora
C) CentOS
D) Linux Mint
Answer: C
Explanation: CentOS is a community rebuild of RHEL, widely used on servers.
**Question 3. The GPL license requires that any modified source code that is distributed must
also be:**
A) Released under a proprietary license
B) Made available under the same GPL license
C) Encrypted before distribution
D) Submitted to the Open Source Initiative for approval
Answer: B
Explanation: GPL is a copyleft license; derivative works must remain under GPL.
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

Partial preview of the text

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

Question 1. Which component of a Linux system is responsible for managing hardware resources and providing system calls to user-space programs? A) Bash shell B) Init system C) Linux kernel D) GNU C Library Answer: C Explanation: The kernel is the core of Linux; it controls hardware, memory, processes, and offers system calls. Question 2. Which of the following distributions is most commonly used for server environments and is based on Red Hat Enterprise Linux? A) Ubuntu B) Fedora C) CentOS D) Linux Mint Answer: C Explanation: CentOS is a community rebuild of RHEL, widely used on servers. Question 3. The GPL license requires that any modified source code that is distributed must also be: A) Released under a proprietary license B) Made available under the same GPL license C) Encrypted before distribution D) Submitted to the Open Source Initiative for approval Answer: B Explanation: GPL is a copyleft license; derivative works must remain under GPL.

Question 4. Which shell interprets the command line by default on most modern Linux distributions? A) csh B) sh C) bash D) fish Answer: C Explanation: Bash (Bourne Again SHell) is the default interactive shell for many distros. Question 5. In Bash, which key combination retrieves the previous command from history? A) Ctrl‑C B) Ctrl‑R C) Up Arrow D) Alt‑F Answer: C Explanation: Pressing the Up Arrow cycles backward through command history. Question 6. Which command provides a short description of another command, using the whatis database? A) man B) info C) whatis D) apropos Answer: C Explanation: whatis displays a one‑line description from the whatis database.

A) Can span different file systems B) Shares the same inode number as the target file C) Increments the link count of the target file D) Is invisible to the find command Answer: A Explanation: Symbolic (soft) links store a pathname and can point to files on other file systems; hard links cannot. Question 11. Which top‑level directory in the Filesystem Hierarchy Standard contains system configuration files? A) /var B) /etc C) /usr D) /opt Answer: B Explanation: /etc holds host‑specific configuration files. Question 12. To locate all files named “httpd.conf” on the system, which command is most appropriate? A) locate httpd.conf B) which httpd.conf C) find / - name httpd.conf 2>/dev/null D) grep - r httpd.conf / Answer: C Explanation: find searches the directory tree; locate relies on an updated database, and which searches the PATH.

Question 13. Which redirection operator overwrites an existing file with the output of a command? A) >> B) >| C) > D) <> Answer: C Explanation: > redirects output, creating the file or truncating it if it exists. Question 14. How would you append the output of ls - l to a file called “listing.txt”? A) ls - l > listing.txt B) ls - l >> listing.txt C) ls - l | listing.txt D) ls - l < listing.txt Answer: B Explanation: >> appends rather than overwriting. Question 15. Which operator is used to send the output of ps aux as input to grep ssh? A) | B) > C) < D) & Answer: A Explanation: The pipe (|) connects the stdout of the first command to the stdin of the second. Question 16. In command substitution, which syntax is preferred for readability?

B) NR

C) NF

D) FS

Answer: B Explanation: NR is the Number of Records (lines) processed so far. Question 20. Which command displays the first 10 lines of a file named “data.log”? A) tail data.log B) head data.log C) less data.log D) cat data.log | head - 10 Answer: B Explanation: head prints the beginning of a file; default is 10 lines. Question 21. Which command would you use to sort the contents of “names.txt” alphabetically and save the result to “sorted.txt”? A) sort names.txt > sorted.txt B) uniq names.txt > sorted.txt C) grep names.txt > sorted.txt D) wc names.txt > sorted.txt Answer: A Explanation: sort orders lines; redirection writes the output to a new file. Question 22. When preparing to install Linux on a new server, which step should be performed first? A) Partition the hard drive B) Verify hardware compatibility

C) Run yum update D) Configure the firewall Answer: B Explanation: Ensuring the hardware can run the chosen distro is the initial planning step. Question 23. Which bootloader is the default for most modern Fedora and Ubuntu installations? A) LILO B) GRUB C) SYSLINUX D) rEFInd Answer: B Explanation: GRUB2 (Grand Unified Bootloader) is the standard bootloader for many distros. Question 24. In the Linux boot process, which component loads the kernel into memory? A) BIOS/UEFI B) Bootloader (GRUB) C) init system D) systemd‑journald Answer: B Explanation: The bootloader reads the kernel image from disk and loads it into RAM. Question 25. Which command sets the system locale to US English with UTF‑8 encoding for all users? A) export LANG=en_US.UTF- 8 B) locale-gen en_US.UTF- 8 C) localedef - i en_US - f UTF-8 en_US.UTF- 8

Answer: A Explanation: usermod - a - G appends the user to supplementary groups without removing existing ones. Question 29. Which file stores the password hashes for local user accounts on most Linux systems? A) /etc/passwd B) /etc/shadow C) /etc/group D) /etc/login.defs Answer: B Explanation: /etc/shadow holds hashed passwords with stricter permissions. Question 30. To allow a user to execute any command as root after authenticating with their own password, which line should be added to /etc/sudoers? A) alice ALL=(ALL) NOPASSWD: ALL B) alice ALL=(ALL) ALL C) %wheel ALL=(ALL) ALL D) root ALL=(ALL) ALL Answer: B Explanation: This gives user “alice” full sudo rights, requiring her password. Question 31. Which command displays a real‑time view of system processes, sorted by CPU usage? A) ps aux B) top C) htop

D) Both B and C Answer: D Explanation: Both top and htop provide interactive, real‑time process monitoring; htop is more user‑friendly. Question 32. To run a command in the background and detach it from the terminal, you would append which symbol? A) & B) ; C) && D) | Answer: A Explanation: The ampersand places the job in the background. Question 33. Which command changes the nice value of a running process with PID 1234 to 10? A) renice - n 10 - p 1234 B) nice - n 10 1234 C) kill - 10 1234 D) prio - n 10 1234 Answer: A Explanation: renice adjusts the scheduling priority of an existing process. Question 34. Which signal number corresponds to the “terminate” signal sent by kill without options? A) 9 B) 15

C) journalctl - u sshd | tail - 50 D) All of the above Answer: D Explanation: All three produce the same result; -n is a shortcut for --lines. Question 38. On a Debian‑based system, which command updates the local package index? A) apt-get update B) yum update C) dnf refresh D) rpm --rebuilddb Answer: A Explanation: apt-get update downloads the latest package lists. Question 39. To install the package “vim” on a Red Hat‑based system, you would run: A) apt install vim B) yum install vim C) pacman - S vim D) emerge vim Answer: B Explanation: yum (or dnf on newer releases) manages RPM packages. Question 40. Which file contains the list of enabled repositories for yum/dnf? A) /etc/apt/sources.list B) /etc/yum.repos.d/*.repo C) /etc/pacman.conf D) /etc/portage/repos.conf

Answer: B Explanation: Repository definitions for yum/dnf are stored as .repo files. Question 41. Which device file represents the first SCSI/SATA hard disk? A) /dev/sda B) /dev/hda C) /dev/vda D) /dev/nvme0n Answer: A Explanation: /dev/sda is the first SCSI/SATA block device. Question 42. Which utility is used to create a new partition table on a disk? A) mkfs B) fdisk C) mount D) dd Answer: B Explanation: fdisk (or gdisk for GPT) creates and manipulates partition tables. Question 43. To format a newly created partition /dev/sdb1 with the ext4 filesystem, you would run: A) mkfs.ext4 /dev/sdb B) format /dev/sdb1 ext C) fdisk - t ext4 /dev/sdb D) mount - t ext4 /dev/sdb1 /mnt Answer: A

Explanation: lvextend and lvresize can both increase LV size; the syntax shown is valid for both. Question 47. Which RAID level provides both striping and mirroring, offering fault tolerance and performance? A) RAID 0 B) RAID 1 C) RAID 5 D) RAID 10 Answer: D Explanation: RAID 10 (1+0) mirrors pairs of disks and stripes across the mirrors. Question 48. What permission bits are represented by the octal value 4755 on an executable file? A) setuid, rwx for owner, r-x for group and others B) setgid, rwx for owner, r-x for group and others C) sticky bit, rwx for owner, r-x for group and others D) No special bits, rwxr-xr-x Answer: A Explanation: The leading 4 sets the setuid bit; 755 gives rwx for owner and r-x for group/others. Question 49. Which command changes the group ownership of file “data.log” to “audit”? A) chown :audit data.log B) chgrp audit data.log C) Both A and B are correct D) chmod g+audit data.log Answer: C

Explanation: chown :audit and chgrp audit both set the group to “audit”. Question 50. To give the user “john” execute permission on a directory without changing other permissions, which symbolic mode would you use? A) chmod u+x directory B) chmod +x directory C) chmod o+x directory D) chmod g+x directory Answer: A Explanation: u+x adds execute permission for the owner (john if he is the owner). Question 51. Which command lists the Access Control List (ACL) entries for the file “project.conf”? A) getfacl project.conf B) setfacl - l project.conf C) ls - l project.conf D) aclget project.conf Answer: A Explanation: getfacl displays ACLs on a file. Question 52. To grant the group “devs” read and write permissions on directory “src”, without affecting existing ACLs, you would run: A) setfacl - m g:devs:rw src B) chmod g+rw src C) chgrp devs src && chmod g+rw src D) setfacl - x g:devs src Answer: A

Answer: A Explanation: free - h prints memory usage with appropriate units. Question 56. To view the current routing table using the ip utility, you would type: A) ip route show B) route - n C) netstat - r D) iptables - L ROUTE Answer: A Explanation: ip route show (or simply ip r) lists routes. Question 57. Which command sends three ICMP echo requests to the host 192.168.1.10? A) ping - c 3 192.168.1. B) traceroute 192.168.1. C) ping 192.168.1.10 - n 3 D) ping - t 3 192.168.1. Answer: A Explanation: -c specifies the count of ping packets. Question 58. To display all listening TCP sockets on the system, which command is appropriate? A) ss - tln B) netstat - tuln | grep LISTEN C) lsof - iTCP - sTCP:LISTEN D) All of the above Answer: D

Explanation: Each command can list listening TCP sockets. Question 59. Which utility captures live network packets and writes them to a file named capture.pcap? A) tcpdump - w capture.pcap B) wireshark - w capture.pcap C) netcat - w capture.pcap D) iptables - A OUTPUT - j LOG --log-prefix "CAP" Answer: A Explanation: tcpdump - w writes raw packet data to a file. Question 60. To configure a static IP address of 10.0.0.5/24 on interface eth0 using the ip command, which sequence is correct? A) ip addr add 10.0.0.5/24 dev eth0 && ip link set eth0 up B) ifconfig eth0 10.0.0.5 netmask 255.255.255.0 up C) ip configure eth0 address 10.0.0.5/ D) Both A and B (they achieve the same result) Answer: A Explanation: ip addr add assigns the address; ip link set up activates the interface. ifconfig is legacy but still works on many systems; however option A uses the preferred modern tool. Question 61. Which file typically contains the system’s hostname on most Linux distributions? A) /etc/hosts B) /etc/hostname C) /etc/resolv.conf D) /etc/sysconfig/network