1. Which command is used to list files in a directory on Linux?
ls
dir
list
show
✅ Correct Answer: ls
2. What is the purpose of the `chmod` command in Linux?
To change file permissions
To list files
To create a directory
To delete a file
✅ Correct Answer: To change file permissions
3. Which command is used to display the current working directory in Linux?
pwd
cd
ls
mkdir
✅ Correct Answer: pwd
4. What is the purpose of the `grep` command in Linux?
To search for text patterns in files
To list files
To create a directory
To delete a file
✅ Correct Answer: To search for text patterns in files
5. Which command is used to create a new directory in Linux?
mkdir
cd
ls
rm
✅ Correct Answer: mkdir
6. What is the purpose of the `sudo` command in Linux?
To execute commands with superuser privileges
To list files
To create a directory
To delete a file
✅ Correct Answer: To execute commands with superuser privileges
7. Which command is used to delete a file in Linux?
rm
cd
ls
mkdir
✅ Correct Answer: rm
8. What is the purpose of the `tar` command in Linux?
To create and extract archive files
To list files
To create a directory
To delete a file
✅ Correct Answer: To create and extract archive files
9. Which command is used to display the contents of a file in Linux?
cat
cd
ls
mkdir
✅ Correct Answer: cat
10. What is the purpose of the `ps` command in Linux?
To display running processes
To list files
To create a directory
To delete a file
✅ Correct Answer: To display running processes
11. Which command is used to change the ownership of a file in Linux?
chown
chmod
ls
mkdir
✅ Correct Answer: chown
12. What is the purpose of the `find` command in Linux?
To search for files and directories
To list files
To create a directory
To delete a file
✅ Correct Answer: To search for files and directories
13. Which command is used to display system information in Linux?
uname
cd
ls
mkdir
✅ Correct Answer: uname
14. What is the purpose of the `df` command in Linux?
To display disk space usage
To list files
To create a directory
To delete a file
✅ Correct Answer: To display disk space usage
15. Which command is used to display the manual for a command in Linux?
man
cd
ls
mkdir
✅ Correct Answer: man
16. What is the purpose of the `kill` command in Linux?
To terminate a process
To list files
To create a directory
To delete a file
✅ Correct Answer: To terminate a process
17. Which command is used to display network interfaces in Linux?
ifconfig
cd
ls
mkdir
✅ Correct Answer: ifconfig
18. What is the purpose of the `scp` command in Linux?
To securely copy files between systems
To list files
To create a directory
To delete a file
✅ Correct Answer: To securely copy files between systems
19. Which command is used to display the system uptime in Linux?
uptime
cd
ls
mkdir
✅ Correct Answer: uptime
20. What is the purpose of the `cron` daemon in Linux?
To schedule tasks
To list files
To create a directory
To delete a file
✅ Correct Answer: To schedule tasks
21. Which command is used to display the last few lines of a file?
tail
head
cat
less
✅ Correct Answer: tail
22. What is the purpose of the `chgrp` command?
To change group ownership of files
To change file permissions
To create groups
To delete groups
✅ Correct Answer: To change group ownership of files
23. Which command is used to search for text patterns in files?
grep
find
locate
which
✅ Correct Answer: grep
24. What is the purpose of the `top` command?
To display active processes
To show disk usage
To list files
To edit files
✅ Correct Answer: To display active processes
25. Which command is used to extract compressed tar archives?
tar -xzf
tar -czf
tar -tvf
tar -xvf
✅ Correct Answer: tar -xzf
26. What is the purpose of the `umask` command?
To set default file permissions
To change user masks
To modify kernel parameters
To unmount filesystems
✅ Correct Answer: To set default file permissions
27. Which command is used to change file timestamps?
touch
time
date
chtime
✅ Correct Answer: touch
28. What is the purpose of the `rsync` command?
To synchronize files between systems
To remove files
To rename files
To compress files
✅ Correct Answer: To synchronize files between systems
29. Which command is used to display disk space usage by directory?
du
df
free
mount
✅ Correct Answer: du
30. What is the purpose of the `lsof` command?
To list open files
To show login sessions
To display file systems
To locate binaries
✅ Correct Answer: To list open files
31. Which command is used to change the default shell for a user?
chsh
usermod
passwd
shell
✅ Correct Answer: chsh
32. What is the purpose of the `journalctl` command?
To view systemd logs
To manage journals
To control system services
To edit configuration files
✅ Correct Answer: To view systemd logs
33. Which command is used to display memory usage?
free
vmstat
top
meminfo
✅ Correct Answer: free
34. What is the purpose of the `dd` command?
To copy and convert files
To delete directories
To display disk usage
To duplicate devices
✅ Correct Answer: To copy and convert files
35. Which command is used to display kernel messages?
dmesg
kmsg
syslog
kernlog
✅ Correct Answer: dmesg
36. What is the purpose of the `passwd` command?
To change user passwords
To modify password policies
To display password hashes
To create new users
✅ Correct Answer: To change user passwords
37. Which command is used to modify user account properties?
usermod
useradd
chuser
moduser
✅ Correct Answer: usermod
38. What is the purpose of the `crontab` command?
To manage scheduled jobs
To create cron tables
To edit system crontab
To display cron history
✅ Correct Answer: To manage scheduled jobs
39. Which command is used to display network connections?
netstat
ifconfig
ip
ss
✅ Correct Answer: netstat
40. What is the purpose of the `alias` command?
To create command shortcuts
To list all commands
To search for binaries
To display command history
✅ Correct Answer: To create command shortcuts
41. Which command is used to display environment variables?
env
export
set
echo
✅ Correct Answer: env
42. What is the purpose of the `history` command?
To display command history
To show system history
To record terminal sessions
To display login history
✅ Correct Answer: To display command history
43. Which command is used to change file group ownership?
chgrp
chown
chmod
chgroup
✅ Correct Answer: chgrp
44. What is the purpose of the `ln` command?
To create links between files
To list network interfaces
To display line numbers
To count lines in files
✅ Correct Answer: To create links between files
45. Which command is used to display CPU information?
lscpu
cpuid
cpuinfo
proc
✅ Correct Answer: lscpu
46. What is the purpose of the `mount` command?
To attach filesystems
To display disk usage
To format disks
To partition disks
✅ Correct Answer: To attach filesystems
47. Which command is used to display running services?
systemctl list-units
service --list
ps aux
top
✅ Correct Answer: systemctl list-units
48. What is the purpose of the `cut` command?
To extract sections from files
To delete file sections
To copy files
To concatenate files
✅ Correct Answer: To extract sections from files
49. Which command is used to display disk partitions?
lsblk
fdisk
parted
blkid
✅ Correct Answer: lsblk
50. What is the purpose of the `sed` command?
To perform text transformations
To search for files
To edit binary files
To secure delete files
✅ Correct Answer: To perform text transformations
51. Which command is used to display hardware information?
lshw
hwinfo
dmidecode
inxi
✅ Correct Answer: lshw
52. What is the purpose of the `awk` command?
To process and analyze text
To format disks
To manage awk files
To display system information
✅ Correct Answer: To process and analyze text
53. Which command is used to display PCI devices?
lspci
pciconf
hwdetect
dmidecode
✅ Correct Answer: lspci
54. What is the purpose of the `sort` command?
To sort lines of text
To organize files
To classify data
To arrange directories
✅ Correct Answer: To sort lines of text
55. Which command is used to display USB devices?
lsusb
usbdev
hwdetect
dmidecode
✅ Correct Answer: lsusb
56. What is the purpose of the `uniq` command?
To report or filter repeated lines
To count unique files
To display unique devices
To find unique processes
✅ Correct Answer: To report or filter repeated lines
57. Which command is used to display kernel parameters?
sysctl
kerninfo
uname
dmesg
✅ Correct Answer: sysctl
58. What is the purpose of the `tee` command?
To redirect output to multiple locations
To display tree structures
To create T-shaped outputs
To split terminal windows
✅ Correct Answer: To redirect output to multiple locations
59. Which command is used to display module dependencies?
modinfo
lsmod
depmod
modprobe
✅ Correct Answer: modinfo
60. What is the purpose of the `tr` command?
To translate or delete characters
To track files
To transfer data
To truncate files
✅ Correct Answer: To translate or delete characters
61. Which command is used to display loaded kernel modules?
lsmod
modinfo
depmod
modprobe
✅ Correct Answer: lsmod
62. What is the purpose of the `wc` command?
To count words, lines, and characters
To write configuration
To watch changes
To word-wrap text
✅ Correct Answer: To count words, lines, and characters
63. Which command is used to display system uptime?
uptime
time
w
last
✅ Correct Answer: uptime
64. What is the purpose of the `xargs` command?
To build and execute command lines
To examine arguments
To extend archives
To execute X commands
✅ Correct Answer: To build and execute command lines
65. Which command is used to display logged-in users?
who
users
last
w
✅ Correct Answer: who
66. What is the purpose of the `yes` command?
To output a string repeatedly
To confirm actions
To answer prompts automatically
To validate input
✅ Correct Answer: To output a string repeatedly
67. Which command is used to display disk I/O statistics?
iostat
vmstat
mpstat
sar
✅ Correct Answer: iostat
68. What is the purpose of the `zcat` command?
To view compressed files
To zip catalogs
To compress archives
To display zsh configurations
✅ Correct Answer: To view compressed files
69. Which command is used to display process resource usage?
pidstat
top
ps
htop
✅ Correct Answer: pidstat
70. What is the purpose of the `watch` command?
To execute a program periodically
To monitor log files
To observe system calls
To display clock time
✅ Correct Answer: To execute a program periodically
71. Which command is used to display memory statistics?
vmstat
free
top
sar
✅ Correct Answer: vmstat
72. What is the purpose of the `last` command?
To display login history
To show recent commands
To list last modified files
To display final lines of files
✅ Correct Answer: To display login history
73. Which command is used to display CPU statistics?
mpstat
top
ps
htop
✅ Correct Answer: mpstat
74. What is the purpose of the `file` command?
To determine file type
To search for files
To manage file systems
To display file contents
✅ Correct Answer: To determine file type
75. Which command is used to display system activity reports?
sar
vmstat
iostat
mpstat
✅ Correct Answer: sar
76. What is the purpose of the `diff` command?
To compare files line by line
To differentiate file types
To display file differences
To find different files
✅ Correct Answer: To compare files line by line
77. Which command is used to display network statistics?
netstat
ss
ip
ifconfig
✅ Correct Answer: netstat
78. What is the purpose of the `comm` command?
To compare sorted files line by line
To combine files
To comment files
To compress files
✅ Correct Answer: To compare sorted files line by line
79. Which command is used to display process tree?
pstree
tree
ps
htop
✅ Correct Answer: pstree
80. What is the purpose of the `column` command?
To format output into columns
To display column definitions
To create columnar databases
To align text in files
✅ Correct Answer: To format output into columns
81. Which command is used to display system load averages?
uptime
loadavg
top
w
✅ Correct Answer: uptime
82. What is the purpose of the `fold` command?
To wrap lines to specified width
To create directories
To display folder contents
To format disks
✅ Correct Answer: To wrap lines to specified width
83. Which command is used to display kernel ring buffer messages?
dmesg
klog
syslog
journalctl
✅ Correct Answer: dmesg
84. What is the purpose of the `join` command?
To combine lines from two files
To connect to networks
To merge directories
To concatenate files
✅ Correct Answer: To combine lines from two files
85. Which command is used to display disk partition tables?
fdisk -l
parted
lsblk
blkid
✅ Correct Answer: fdisk -l
86. What is the purpose of the `paste` command?
To merge lines of files
To combine files
To create backups
To duplicate files
✅ Correct Answer: To merge lines of files
87. Which command is used to display system information?
uname -a
sysinfo
hostinfo
systeminfo
✅ Correct Answer: uname -a
88. What is the purpose of the `split` command?
To split files into pieces
To divide disks
To separate network traffic
To partition memory
✅ Correct Answer: To split files into pieces
89. Which command is used to display process status?
ps
top
htop
proc
✅ Correct Answer: ps
90. What is the purpose of the `tac` command?
To display files in reverse
To concatenate files
To count lines
To track changes
✅ Correct Answer: To display files in reverse
The CompTIA_XK0_005_Linux_Plus certification is a globally recognized credential for IT professionals.
This practice test helps you prepare by covering key topics like hardware, networking, troubleshooting, and security.
Want more practice? Check out our other mock exams: