1. Which command lists files in a directory?
A) show
B) dirlist
C) ls
D) list
Answer: C
2. Which command shows the current directory?
A) pwd
B) cwd
C) where
D) dir
Answer: A
3. Which command is used to change directories?
A) move
B) cd
C) chdir
D) switch
Answer: B
4. Which command displays the contents of a file?
A) read
B) cat
C) show
D) print
Answer: B
5. Which command shows the first 10 lines of a file?
A) start
B) head
C) top
D) first
Answer: B
6. Which command shows the last 10 lines of a file?
A) tail
B) end
C) bottom
D) last
Answer: A
7. Which command searches for a pattern in a file?
A) find
B) search
C) grep
D) locate
Answer: C
8. What does chmod do?
A) Change ownership
B) Modify permissions
C) Delete files
D) Move files
Answer: B
9. Which command changes file ownership?
A) chown
B) chmod
C) own
D) setuser
Answer: A
10. Which command removes a file?
A) del
B) delete
C) rm
D) removefile
Answer: C
11. Which command copies files?
A) cp
B) copy
C) mv
D) clone
Answer: A
12. Which command moves or renames files?
A) move
B) mv
C) rename
D) switch
Answer: B
13. Which command creates a new directory?
A) newdir
B) mkdir
C) makedir
D) createdir
Answer: B
14. Which command removes a directory?
A) rmdir
B) removedir
C) deldir
D) rm -d
Answer: A
15. What does sudo allow you to do?
A) Switch user
B) Execute command as superuser
C) Edit files
D) Shut down system
Answer: B
16. Which command displays running processes?
A) ps
B) proc
C) listproc
D) jobs
Answer: A
17. Which command shows real-time process usage?
A) ps -a
B) top
C) live
D) monitor
Answer: B
18. Which command kills a process?
A) stop
B) kill
C) end
D) halt
Answer: B
19. Which signal is default for kill?
A) SIGSTOP
B) SIGTERM
C) SIGKILL
D) SIGINT
Answer: B
20. Which command displays disk usage?
A) df
B) disk
C) du
D) space
Answer: A
21. Which command shows file disk usage?
A) df
B) du
C) size
D) usage
Answer: B
22. Which command shows memory usage?
A) mem
B) free
C) ram
D) usage
Answer: B
23. Which command displays current user?
A) user
B) id
C) whoami
D) me
Answer: C
24. Which file stores user account info?
A) /etc/users
B) /etc/passwd
C) /etc/account
D) /etc/profile
Answer: B
25. Which command downloads files from URL?
A) curl
B) fetch
C) wget
D) Both A and C
Answer: D
26. Which operator redirects output?
A) <
B) >
C) |
D) &
Answer: B
27. What does | (pipe) do?
A) Redirects error
B) Combines commands
C) Sends output to next command
D) Creates file
Answer: C
28. Which command finds files by name?
A) locate
B) find
C) search
D) grep
Answer: B
29. Which command shows system uptime?
A) time
B) uptime
C) live
D) sysinfo
Answer: B
30. Which command shows hostname?
A) host
B) hostname
C) name
D) server
Answer: B
31. Which command edits files in terminal?
A) nano
B) vim
C) vi
D) All of the above
Answer: D
32. Which command compresses files using gzip?
A) zip
B) tar
C) gzip
D) compress
Answer: C
33. Which command creates a tar archive?
A) gzip
B) tar
C) zip
D) archive
Answer: B
34. Which command checks network connectivity?
A) netstat
B) ping
C) route
D) trace
Answer: B
35. Which command shows IP address?
A) ifconfig
B) ip addr
C) Both A and B
D) netstat
Answer: C
36. Which command displays open ports?
A) netstat -tuln
B) ports
C) open
D) listen
Answer: A
37. Which command schedules tasks?
A) cron
B) at
C) crontab
D) schedule
Answer: C
38. Which file contains cron jobs?
A) /etc/cron
B) /etc/crontab
C) /var/cron
D) /cron/jobs
Answer: B
39. Which command switches user?
A) su
B) sudo
C) switch
D) login
Answer: A
40. Which command prints environment variables?
A) printenv
B) env
C) set
D) All of the above
Answer: D
41. Which command creates symbolic link?
A) ln -s
B) link
C) symlink
D) shortcut
Answer: A
42. Which command shows manual page?
A) help
B) man
C) info
D) guide
Answer: B
43. Which command shows command history?
A) history
B) past
C) log
D) commands
Answer: A
44. Which command clears terminal?
A) reset
B) clean
C) clear
D) cls
Answer: C
45. Which permission gives execute access?
A) r
B) w
C) x
D) e
Answer: C
46. What does chmod 755 mean?
A) Full access to all
B) Owner full, others read/execute
C) Read only
D) No access
Answer: B
47. Which command shows groups of a user?
A) groups
B) id
C) Both A and B
D) whoami
Answer: C
48. Which command displays kernel info?
A) uname -r
B) kernel
C) sysinfo
D) version
Answer: A
49. Which command extracts tar.gz file?
A) tar -xvf
B) tar -xzvf
C) unzip
D) gzip -d
Answer: B
50. Which command monitors logs in real time?
A) tail -f
B) watch
C) log
D) top
Answer: A
Conclusion: Linux Command Line Mastery for DevOps
Mastering the Linux command line is a core skill for every DevOps engineer. From managing files and processes to troubleshooting servers, automating tasks, and monitoring system performance, the terminal is where real DevOps work happens.
If you scored high on this quiz great job! You’re building a strong foundation.
If not, don’t worry every command you review brings you one step closer to confidence and efficiency.
In real-world DevOps environments, Linux knowledge supports tools like container platforms, CI/CD pipelines, cloud deployments, and infrastructure automation. Strong command-line skills help you:
- Debug production issues faster
- Write better automation scripts
- Manage servers efficiently
- Pass DevOps interviews and certifications
- Work confidently in cloud environments
The key is consistent practice. Open your terminal daily. Experiment. Break things (safely). Fix them.
Pro Tip: Try recreating real scenarios monitor logs, create users, manage permissions, set up cron jobs instead of just memorizing commands.
- If you want to explore DevOps, start your training here.



