Unlock hundreds more features
Save your Quiz to the Dashboard
View and Export Results
Use AI to Create Quizzes and Analyse Results

Sign inSign in with Facebook
Sign inSign in with Google

Take the DevOps/Linux Command-Line Proficiency Quiz

Evaluate Your Linux Shell and DevOps Skills

Difficulty: Moderate
Questions: 20
Learning OutcomesStudy Material
Colorful paper art promoting a DevOpsLinux Command-Line Proficiency Quiz

Ready to sharpen your Linux command-line and DevOps skills? This comprehensive quiz equips aspiring sysadmins and DevOps engineers with real-world shell scenarios. For a quick refresher on essential commands, try our Linux Basics Quiz, or deepen your theory with the DevOps Foundations Knowledge Test . Every question can be freely adjusted in our editor to suit your learning path. Explore more quizzes and start testing your proficiency today!

Which command displays the current working directory?
pwd
cd
ls
dir
The pwd command prints the full pathname of the current working directory. None of the other commands output the current directory path.
What command moves you up one directory level?
cd ..
cd ~
cd /
cd home
Using cd .. changes the working directory to the parent of the current directory. The other options change to the home directory or absolute paths.
Which command lists files in long format including permissions, owner, and size?
ls -l
ls -a
ls -h
ls -r
The ls -l option displays files in long format with permissions, owner, group, size, and timestamp. The other options show hidden files, human-readable sizes, or reverse order instead.
Which command changes file permissions?
chmod
chown
umask
chgrp
The chmod command modifies the read, write, and execute permissions of a file or directory. chown changes ownership, umask sets default permissions, and chgrp changes group ownership.
Which command terminates a process by specifying its PID?
kill
ps
stop
pause
The kill command sends a signal (by default SIGTERM) to a process identified by its PID. ps lists processes but does not terminate them, and stop/pause are not standard termination commands.
How do you change the owner to alice and group to developers for file.txt?
chown alice:developers file.txt
chown alice.developers file.txt
chgrp developers file.txt
chmod 750 file.txt
The chown command with the syntax user:group sets both owner and group at once. chgrp only changes the group, and chmod sets permissions rather than ownership.
Which kill option sends SIGKILL to a process?
kill -9
kill -1
kill -15
kill -s SIGINT
kill -9 sends the SIGKILL signal, which forcibly terminates a process. The other options send different signals such as SIGHUP, SIGTERM, or SIGINT.
In the top command, which key sorts processes by memory usage?
M
P
T
C
Pressing M in top will sort the displayed processes by memory usage in descending order. P sorts by CPU usage, T by time, and C toggles the display of the command name.
Which command traces the network path to a remote host?
traceroute
ping
netstat
mtr
traceroute sends packets with increasing TTL values and lists each hop to the destination. ping tests reachability, netstat shows network connections, and mtr combines ping and traceroute but is a different tool.
Which ping option sends exactly 5 packets to the target?
ping -c 5
ping -n 5
ping -l 5
ping -t 5
The -c option in ping specifies the count of packets to send. The other options are used for Windows ping or different flags in other tools.
Which shebang line ensures a script uses the Bash interpreter located at /bin/bash?
#!/bin/bash
#!/bin/sh
#!/usr/bin/env python
#!/usr/bin/perl
Using #!/bin/bash at the top of a script tells the system to execute the script with the Bash shell. #!/bin/sh may invoke a different shell, and the others invoke Python or Perl.
Which is the correct syntax for a Bash for loop iterating over "foo" and "bar"?
for item in foo bar; do echo $item; done
for item on foo bar; do echo $item; done
for $item in foo bar; echo $item; done
do for item in foo bar; echo $item; end
The correct Bash for loop syntax is for in ; do ; done. The other options misuse keywords or punctuation.
Which command shows system uptime and load average?
uptime
top
vmstat
free
The uptime command reports how long the system has been running along with the 1, 5, and 15-minute load averages. top and vmstat provide more detailed stats but not the simple uptime summary.
Which path is an absolute path?
/var/log
var/log
~/var/log
../var/log
An absolute path starts from the root directory and begins with '/'. The others are relative paths (to the home directory or parent directory).
Which command changes only the group ownership of a file?
chgrp developers file.txt
chown root:developers file.txt
chmod g+w file.txt
chown alice file.txt
The chgrp command modifies only the group ownership of a file. chown with user:group changes both owner and group, and chmod adjusts permissions.
Which kill command sends SIGINT to a process with PID 1234?
kill -2 1234
kill -15 1234
kill -9 1234
kill -s SIGTERM 1234
Signal number 2 corresponds to SIGINT. kill -2 sends that signal, while -15 sends SIGTERM and -9 sends SIGKILL.
In Bash scripting, how do you test if variable var is empty?
if [ -z "$var" ]; then
if [ -n "$var" ]; then
if [ "$var" = "" ] ; then
if [ -e "$var" ]; then
The -z test returns true if the string is empty. -n tests for non-empty, ="" is less portable, and -e tests file existence.
Which command provides disk I/O statistics on a Linux system?
iostat
vmstat
netstat
top
iostat reports CPU and disk I/O statistics. vmstat covers virtual memory and processes, netstat covers network, and top covers CPU/memory usage.
Which command safely handles filenames with spaces when using find and xargs?
find . -type f -print0 | xargs -0 grep pattern
find . | xargs grep pattern
find . -print | xargs -0 grep pattern
find . -type f | xargs -0 grep pattern
Using -print0 with find and -0 with xargs ensures null-terminated input, safely handling spaces and special characters in filenames. The others may split on spaces.
In vmstat output, what does the "si" column represent?
Memory swapped in from disk
Memory swapped out to disk
CPU seconds idle
System interrupts
In vmstat, 'si' stands for the amount of memory swapped in from disk per second. 'so' stands for swapped out, and other columns cover CPU or interrupt metrics.
0
{"name":"Which command displays the current working directory?", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which command displays the current working directory?, What command moves you up one directory level?, Which command lists files in long format including permissions, owner, and size?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}

Learning Outcomes

  1. Analyse directory navigation using common Linux commands
  2. Apply file permission changes with chmod and chown
  3. Demonstrate process management using ps, top, and kill
  4. Identify network diagnostic commands like ping and traceroute
  5. Master basic shell scripting constructs for automation
  6. Evaluate system monitoring outputs for performance insights

Cheat Sheet

  1. Mastering Directory Navigation - Ready to become a file explorer wizard? With cd you can teleport between folders, ls lets you peek inside them, and pwd always reveals your current location. Practice moving around until you can navigate blindfolded (metaphorically, of course). Introduction to the Linux Command Line
  2. Introduction to the Linux Command Line
  3. Changing File Permissions with chmod - Ever wished you had a secret knock to control who reads, writes, or executes your files? chmod is that knock! Learn both numeric (e.g., 755) and symbolic (rwx) modes to set permissions like a pro. Linux File Permissions
  4. Linux File Permissions
  5. Changing File Ownership with chown - In a multi-user realm, chown is your magic wand to reassign files to the right users or groups. One simple command (chown user:group file) keeps access under your control and avoids "Oops, I can't read that!" moments. Linux File Permissions
  6. Linux File Permissions
  7. Monitoring Processes with ps and top - Think of ps as your snapshot camera for running processes and top as your live-feed TV. Spot resource hogs, see CPU and memory usage in real time, and become the ultimate system traffic cop. Pro tip: hit "q" to exit top when you've got the scoop. Linux ps Command
  8. Linux ps Command
  9. Terminating Processes with kill - When a stubborn process refuses to quit, kill comes to the rescue. Send a gentle nudge with kill PID, or go full action-hero with kill -9 for an immediate shutdown. Master this and you'll never be stuck with a frozen program again. Linux kill Command
  10. Linux kill Command
  11. Diagnosing Network Issues with ping - Want to check if your machine can hear a server's "Hello"? ping sends tiny echo requests and measures the response time, helping you pinpoint network hiccups fast. It's the first step in any connectivity investigation. Linux ping Command
  12. Linux ping Command
  13. Tracing Network Routes with traceroute - Follow the breadcrumbs of your data packets as they hop from server to server. traceroute maps out every step on the journey, revealing delays and routing loops along the way. It's like GPS for your network traffic. Linux traceroute Command
  14. Linux traceroute Command
  15. Writing Basic Shell Scripts - Automate your daily grind by scripting repetitive tasks: loops to repeat actions, conditionals to make decisions, and variables to keep track of data. Start with a "Hello, World!" script, crank up its permissions, and watch your productivity skyrocket. Introduction to Shell Scripting
  16. Introduction to Shell Scripting
  17. Monitoring System Performance - Keep an eye on your machine's pulse with tools like vmstat for memory, iostat for disk I/O, and sar for historical stats. Schedule these reports with cron and stay ahead of performance surprises. Think of it as your system's health report card! Linux Performance Monitoring
  18. Linux Performance Monitoring
  19. Understanding File Permissions and Ownership - Dive deep into the rwx world to grasp why read, write, and execute flags matter, and how user/group ownership shapes security. A quick ls -l will show you who's boss and who has access. Get this right and keep unwanted intruders at bay! Linux File Permissions
  20. Linux File Permissions
Powered by: Quiz Maker