Top 76 Linux Shell, Networking & Server Management Quiz Questions with Answers
This article presents a comprehensive collection of 76 multiple‑choice questions covering Linux shell commands, networking fundamentals, and server management topics, each with four options and the correct answer provided, making it an ideal study resource for system administrators and IT students.
Shell Section
In the shell, there are four ways to assign a variable; the method using name=12 is called ( ). A. Direct assignment B. Using read command C. Using command‑line arguments D. Using command output
The command that can extract specified content from each line of a text file is ( ). A. cp B. dd C. fmt D. cut In a Shell script, the command used to read each field of a file and assign it to a Shell variable is ( ). A. fold B. join C. tr D. read To exit interactive mode of the shell, you should type ( ). A. ; B. ^q C. exit D. quit Which of the following is a valid shell variable name? ( ). A. -2-time B. _2$3 C. trust_no_1 D. 2004file Which of the following is a feature of the shell? ( ). A. Pipe B. Input/Output redirection C. Background process execution D. Command processing
Regarding the shell variable FRUIT, which operation is correct? ( ). A. Assign value: $FRUIT=apple B. Display value: fruit=apple C. Display value: echo $FRUIT D. Test if variable has a value: [ -f "$FRUIT" ] Answers: ADDCCCC
Network Section
Which of the following network protocols is connection‑oriented? ( ). A. Transmission Control Protocol (TCP) B. User Datagram Protocol (UDP) C. Internet Protocol (IP) D. Internet Control Message Protocol (ICMP)
To enable a host to communicate with another LAN, which action is required? ( ). A. Configure a DNS server B. Define a route to the local network C. Define a route to the local network gateway D. Define a route to the target network gateway
Answers: AC
Server Management Section
In /etc/fstab, which mount option is typically used for CD‑ROM and other removable devices? ( ). A. defaults B. sw C. rw and ro D. noauto (Note: noauto only mounts on command)
Linux file permissions consist of 10 bits divided into four fields; the third field represents ( ). A. File type B. Owner permissions C. Group permissions D. Other users' permissions
To terminate a foreground process, which command can be used? ( ). A. kill B. ;+C C. shutdown D. halt When creating a new directory with mkdir, which option creates missing parent directories? ( ). A. -m B. -d C. -f D. -p Which statement about inodes is incorrect? ( ). A. Each inode corresponds one‑to‑one with a file B. An inode can describe the number of blocks a file uses C. An inode records file size and pointers to data blocks D. Inodes enable conversion between logical and physical file structures
Which command, having many C‑language features, is also called a filter? ( ). A. csh B. tcsh C. awk (awk detailed) D. sed To set up dynamic routing, which file(s) are needed? ( ). A. /etc/hosts B. /etc/HOSTNAME C. /etc/resolv.conf D. /etc/gateways For a LAN with network address 192.168.1.0/24 and gateway 192.168.1.1, a host 192.168.1.20 accessing 172.16.1.0/24 should use which routing command? ( ). A.
route add –net 192.168.1.0 gw 192.168.1.1 netmask 255.255.255.0 metric 1B.
route add –net 172.16.1.0 gw 192.168.1.1 netmask 255.255.255.255 metric 1C.
route add –net 172.16.1.0 gw 172.16.1.1 netmask 255.255.255.0 metric 1D. route add default 192.168.1.0 netmask 172.168.1.1 metric 1 Which statement is NOT within the scope of the ifconfig command? ( ). A. Configure the loopback address B. Configure the NIC IP address C. Activate the network adapter D. Load the NIC driver into the kernel
Which of the following statements about links is incorrect? ( ). A. A hard link makes the link file's inode point to the target file's inode B. Both hard links and symbolic links create a new inode C. Links are divided into hard links and symbolic links D. Hard links cannot link directory files
When a host in a LAN can ping other LAN hosts but not external Internet hosts, the likely cause is ( ). A. Incorrect host IP configuration B. No gateway set for the LAN C. Incorrect gateway configuration on the LAN or host D. Incorrect DNS server configuration
Which file contains host‑to‑IP mappings? ( ). A. /etc/HOSTNAME B. /etc/hosts C. /etc/resolv.conf D. /etc/networks In which situation is recompiling the kernel NOT required? ( ). A. Deleting unused device drivers B. Upgrading the kernel C. Adding new hardware D. Activating a network card
Which of the following is NOT a Linux process type? ( ). A. Interactive process B. Batch process C. Daemon process D. Ready process (process state)
Which configuration file must be edited to modify an Apache server? ( ). A. httpd.conf B. access.conf C. srm.conf D. named.conf Which subsystem is NOT part of the Linux kernel? ( ). A. Process management B. Memory management C. I/O management D. Hardware management
In daily management, which CPU condition most affects system performance? ( ). A. CPU at full load B. CPU efficiency at 30 % C. CPU efficiency at 50 % D. CPU efficiency at 80 %
If a computer has 128 GB of RAM, the typical swap partition size is ( ). A. 4 GB B. 16 GB C. 64 GB D. 256 GB
To view a file with cursor‑based scrolling, which command should be used? ( ). A. cat B. more C. less D. head In the TCP/IP model, which application protocol enables file transfer between a local and remote host? ( ). A. telnet B. FTP C. SNMP D. NFS
Which command traces the route to a remote network to locate where a problem occurs? ( ). A. ping B. ifconfig C. traceroute D. netstat After executing chmod 551 fido, the resulting permission string is ( ). A. -rwxr-xr-x B. -rwxr--r-- C. -r--r--r-- D. -r-xr-x--x Which file listed by ls –al is a symbolic link? ( ). A. -rw-rw-rw- 2 hel-s users 56 Sep 09 11:05 hello B. -rwxrwxrwx 2 hel-s users 56 Sep 09 11:05 goodbey C. drwxr--r-- 1 hel users 1024 Sep 10 08:10 zhang D. lrwxr--r-- 1 hel users 2024 Sep 12 08:12 cheng Which of the following is NOT a DNS server type? ( ). A. Primary Master Server B. Secondary Master Server C. samba D. Cache‑only Server
Mail forwarding agents (mail relays) can use SMTP and also which protocol? ( ). A. FTP B. TCP C. UUCP D. POP
To start the Samba server as a standalone process, which file is used? ( ). A. /usr/sbin/smbd B. /usr/sbin/nmbd C. rc.samba D. /etc/inetd.conf DHCP assigns which type of address to hosts? ( ). A. Network address B. MAC address C. TCP address D. IP address
Which command is used for archiving files? ( ). A. dd B. cpio C. gzip D. tar Which command changes a file's owner? ( ). A. chmod B. touch C. chown D. cat Which command searches for strings matching a condition in a file? ( ). A. grep B. gzip C. find D. sort Which command creates a new empty file? ( ). A. chmod B. more C. cp D. touch Which command cannot display the contents of a text file? ( ). A. more B. less C. tail D. join When logging into an FTP server anonymously, the username is ( ). A. users B. anonymous C. root D. guest
To get help for the logname command, you would type ( ). A. logname –man B. logname/? C. help logname D. logname –help File permission symbols for read, write, execute are ( ). A. rwx B. xrw C. rdx D. srw
Linux file names may be up to ( ) characters long. A. 64 B. 128 C. 256 D. 512
To run a process in the background, which symbol is appended to the command? ( ). A. & B. @ C. # D. $
The crontab file consists of six fields in the order ( ). A. MIN HOUR DAY MONTH YEAR COMMAND B. MIN HOUR DAY MONTH DAYOFWEEK COMMAND C. COMMAND HOUR DAY MONTH DAYOFWEEK D. COMMAND YEAR MONTH DAY HOUR MIN
FTP file transfer supports two modes: ( ). A. Word and binary B. .txt and Word Document C. ASCII and binary D. ASCII and Rich Text Format
If a file has group‑other permissions set to read‑only, owner full permissions, and group read‑write, the permission code is ( ). A. 467 B. 674 C. 476 D. 764
When testing DNS, the command to notify the named process (PID 53) to reread its configuration is ( ). A. kill –USR2 53 B. kill –USR1 53 C. kill -INT 63 D. kill –HUP 53 The default listening port for an Apache server is ( ). A. 1024 B. 800 C. 80 (http)
D. 8
Combining PHP and MySQL on a web server solves ( ). A. Proxy database access issues B. Web server hacking problems C. Database access problems on the web server D. Sendmail database access issues
OpenSSL is a ( ). A. Encryption software B. Mail system C. Database management system D. Embedded scripting language
To mount a Windows C: drive (hda1) at /winsys on Linux, the correct command is ( ). A. mount dev/had1 /winsys B. mount /dev/had1 /winsys C. mount /dev/had1 winsys D. mount dev/had1 winsys After changing directory with cd while the current directory is /usr/local, the new current directory is ( ). A. /home B. /root C. /home/root D. /usr/local
The flag for character device files is ( ). A. p B. c C. s D. l
To run a command in the background that redirects file to file.copy, you would use ( ). A. cat file > file.copy & B. cat > file.copy C. cat file file.copy & D. cat file > file.copy & In a DNS configuration file, which record type denotes an alias? ( ). A. NS B. CNAME C. NAME D. CN
qmail is ( ). A. A mail‑receiving protocol B. A type of mail server C. A mail‑sending protocol D. A mail queue
To page through a directory listing with file details, the correct command is ( ). A. more ls –al B. more –al ls C. more < ls –al D. ls –al | more Which statement about the at command is incorrect? ( ). A. To run clear at 23:00 today: at 23:00 today clear B. To run date at 6 am on Jan 1: at 6am Jan 1 date C. In crontab, nightly 23:00 date is 0 23 * * * date D. Hourly clear in crontab is 0 */1 * * * clear If user2 wants to modify file1 owned by user1 with permissions 644, user2 needs which permission? ( ). A. 744 B. 664 C. 646 D. 746
To configure an anonymous FTP server, which file should be edited? ( ). A. /etc/gateway B. /etc/ftpservers C. /etc/ftpusers D. /etc/inetd.conf
Samba server processes consist of ( ). A. named and sendmail B. smbd and nmbd C. bootp and dhcpd D. httpd and squid
To configure an NFS server, the main configuration file on the server side is ( ). A. /etc/rc.d/rc.inet1 B. /etc/rc.d/rc.M C. /etc/exports D. /etc/rc.d/rc.S
To ensure the DHCP daemon starts automatically at boot, edit which file? ( ). A. /etc/rc.d/rc.inet2 B. /etc/rc.d/rc.inet1 C. /etc/dhcpd.conf D. /etc/rc.d/rc.S
When configuring a proxy server with a cache size of 64 MB, the correct configuration line is ( ). A. cache 64MB B. cache_dir ufs /usr/local/squid/cache 10000 16 256 C. cache_mgr 64MB D. cache_mem 64MB Which of the following is part of security management? ( ). A. Configuring device parameters B. Collecting network performance data C. Controlling and maintaining access permissions D. Monitoring faults
Which command pair is correct? ( ). A. ls and sl B. cat and tac C. more and erom D. exit and tixe
Which command saves and exits in vi? ( ). A. :q B. ZZ C. :q! D. :WQ
Which statement is NOT a difference between a process and a program? ( ). A. A program is static code; a process is an execution of that code B. Programs run only in the foreground, processes can run in foreground or background C. Programs persist; processes are temporary D. Programs have no state; processes have state
Answers: DC BDA ... (full answer strings as provided in the original source after each section)
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
