Top 100 Linux Command Quiz: Test Your Sysadmin Knowledge
This comprehensive multiple‑choice quiz covers essential Linux commands, system‑administration tasks, daemon management, file permissions, networking utilities, and package handling, providing a practical way to assess and reinforce your command‑line expertise.
Linux Commands and System‑Administration Quiz – Questions, Correct Answers, and Brief Explanations
What is the purpose of the cron daemon? D – Scheduling daily system tasks . Cron runs scheduled jobs defined in crontabs.
Which of the following is a block device on most Linux systems? B – Hard disk . Block devices provide buffered I/O and include disks and partitions.
Which command displays output one page at a time? C – more . It pauses after each screenful of text.
How can you find out how much space is left in the current directory? B – du . . du reports disk usage of the specified path.
Which command changes a file's permission settings? B – chmod . It modifies the read/write/execute bits.
How to determine which RPM package provides /etc/my.conf ? C – rpm -qf /etc/my.conf . The -qf query finds the owning package.
Switch from runlevel 3 to runlevel 5 without rebooting? B – telinit 5 . telinit changes the system's runlevel.
Command to change IDE hard‑disk settings? C – hdparm . It configures SATA/IDE drive parameters.
List tasks scheduled to run once at a specific future time? A – atq . It shows the pending at jobs.
Effect of set PS1="[\u\w\t]$"; export PS1 ? B – Changes the command prompt . PS1 defines the primary shell prompt.
Where to place a default .bashrc for new users? A – /etc/skel/ . Files in this directory are copied to new home directories.
Purpose of the export command in bash? C – Sets environment variables for other programs . Exported variables are inherited by child processes.
Correct permissions for /etc/passwd and /etc/shadow on a shadow‑password system? C – -rw-r--r-- for /etc/passwd , -r-------- for /etc/shadow .
Parameter to delete a user and also remove the user's home directory? C – userdel -r . The -r flag removes the home directory.
Crontab entry to run mybackup at 1 PM and 8 PM Monday‑Friday? B – 0 13,20 * * 1,2,3,4,5 mybackup .
Command to unmount a currently mounted filesystem? A – umount . It detaches the filesystem from the mount point.
Default file permissions for a newly created file when umask is 022? D – rw-r--r-- . The umask removes write permission for group and others.
How to locate the binary path of Xconfigurator ? D – which Xconfigurator . which searches the PATH.
Command to mount all filesystems defined in /etc/fstab ? B – mount -a .
After creating a symbolic link new → old , if old is deleted, can the data still be accessed via new ? B – Yes . The symlink points to the inode; if the inode is removed, the link becomes dangling.
Default percentage of space reserved for the root user on ext2/3/4 filesystems? C – 10% .
Command to show inode usage per partition? A – df -i .
Runlevel that provides a graphical interface on most Linux distributions? D – 5 .
Find all manual pages containing the word "print"? D – apropos print .
What does man 5 passwd display? B – The structure of the passwd file (section 5 of the manual).
Command to list lines starting with an asterisk (*) in a file? D – grep '^\*' file .
Which ps option shows processes of all users? D – -x .
Command to display the contents of a binary file? A – od (octal dump).
How to count the number of registered users (including system accounts) on a Linux system? D – wc --lines /etc/passwd .
Character that indicates line continuation in a shell script? B – Backslash ( \ ) .
Effect of kill 9 ? C – Sends SIGKILL to the process with PID 9 . SIGKILL cannot be caught.
Command to remove a non‑empty directory /tmp ? B – rm -rf /tmp .
Schedule cmd1 to run at midnight today? D – echo "cmd1" | at midnight .
Correct order for restoring from incremental backups? A – Restore the last full backup first, then apply incremental backups from oldest to newest.
File to edit for setting environment variables for all users? B – /etc/profile .
How to bypass an alias for ls and use the original command? A – \ls . The leading backslash disables alias expansion.
Correct shebang line for a Linux shell script? B – #!/bin/sh .
Syntax to run cmd2 only if cmd1 succeeds? A – cmd1 && cmd2 .
File that defines I/O ports of network cards? C – /proc/ioports .
Software that provides TCP/IP packet filtering on Linux? C – iptables .
Command to pause a print queue? C – lpc (line printer control).
Vi command to exit without saving? D – :q! .
Default font server for XFree86 3.x? A – xfs .
Command to test basic network connectivity? A – ping .
Protocol that uses more than one port? B – FTP (uses separate control and data ports).
PPP authentication protocol that does NOT transmit passwords in clear text? D – CHAP .
Filesystem that should be allocated the most space on a typical Linux system? A – /usr (holds most applications and libraries).
How to install an RPM package on a Debian system? D – alien pkgname.rpm ; dpkg -i pkgname.deb . alien converts the package.
Step in software installation that requires root privileges? D – make install .
Command to update already‑installed RPM packages? B – rpm -F *.rpm (freshen updates only if newer).
Where should LILO be installed on a dual‑boot Linux/Windows system? A – MBR (Master Boot Record) .
Configuration file for ldconfig ? B – /etc/ld.so.conf .
Command to create a .tar.gz archive? C – tar -czvf filename.tgz * .
Daemon that provides network services (e.g., inetd)? D – inetd .
Daemon needed for Linux‑Windows file sharing? B – smbd (Samba daemon).
Default user for Apache child processes? D – nobody .
Default location where sendmail stores undelivered mail? B – /var/spool/mail/ .
Main configuration file for Apache? A – httpd.conf .
Directory where kernel module parameters such as I/O addresses are stored? D – /etc/sysconfig .
Command to disable mail notifications (biff)? A – biff n .
Effect of pressing Control‑Z while a command runs in bash? B – Sends the job to the background (SIGTSTP).
Files that define the user environment in bash? D – .bashrc and .bash_profile .
Command to show shared libraries used by a program? A – ldd .
How to view configuration files of an installed RPM package? A – rpm -qc rpm1 .
Command to display the changelog of an RPM package? C – rpm --changelog postfix .
Makefile target that installs compiled code? D – make install .
Command to extract a .tar.gz archive? B – tar -xzvf filename.tgz .
Section in XF86Config that sets the font file? A – The Fonts section.
What does “8‑bit color” refer to? C – 256 colors .
File that sets the X window display resolution? D – XF86Config .
Environment variable that specifies the X server for remote X applications? A – DISPLAY .
In xdm’s configuration directory, which file defines applications started after a user logs in? A – Xsession (and Xsetup_0 for early setup).
If netstat -a hangs, which subsystem is likely the problem? B – DNS resolution.
Protocol used by ping ? D – ICMP .
Command NOT used for network troubleshooting? B – init (system initialization, not a network tool).
Protocol typically used for dial‑up networking? A – PPP .
Protocol that provides automatic IP address allocation? C – DHCP .
File that defines network service ports? B – /etc/services .
Command to generate a checksum for a file? D – md5sum .
Default location for user mail files? D – /var/spool/mail/ .
File containing the directory list used by the NFS daemon? C – /etc/exports .
How to stop the telnet service on a machine? D – Comment the telnet entry in /etc/xinetd.conf .
File that stores sendmail aliases? A – /etc/aliases .
Configuration file for smbd and nmbd daemons? B – /etc/smb.conf .
Command to unload a kernel module? A – rmmod .
When must you run lilo ? C – After installing a new kernel.
Command to list all loaded kernel modules? A – lsmod .
Command to clear a printer queue? B – lprm - (removes all jobs).
Command to show interrupts used by a network card? B – cat /proc/interrupts .
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
