View Full CompTIA XK0-006 Exam Dumps and Practice Test Dumps.
Question 1
Which command is used to show the current Linux kernel version?
- uname -r
- ls -l
- pwd
- whoami
Correct Answer: 1
Explanation
The uname -r command shows the version of the Linux kernel currently running on the system. This is useful when an administrator needs to check whether the system is using an expected kernel version or when troubleshooting hardware and driver problems. The ls -l command shows detailed file information, pwd displays the current directory, and whoami shows the current user. Kernel information is important because different kernel versions can provide different features, security fixes, hardware support, and performance improvements.
Question 2
Which directory normally contains Linux system configuration files?
- /home
- /etc
- /tmp
- /media
Correct Answer: 2
Explanation
The /etc directory normally contains configuration files used by the Linux operating system and installed services. Administrators often work with files in this directory when configuring networking, users, services, authentication, and other system settings. The /home directory contains users’ personal files. The /tmp directory is used for temporary files, while /media is commonly used for removable media. Understanding the Linux filesystem structure makes administration easier because it helps administrators quickly find the files needed for configuration and troubleshooting.
Question 3
Which command is used to display the current working directory?
- cd
- pwd
- ls
- find
Correct Answer: 2
Explanation
The pwd command means “print working directory” and displays the full path of the directory where the user is currently working. For example, if the user is inside /home/admin/documents, running pwd will show that path. The cd command changes directories, while ls displays files and directories. The find command searches for files and directories. Knowing the current location is important when working with relative paths because commands may affect different files depending on the directory where they are executed.
Question 4
Which command is commonly used to list files and directories?
- ls
- cat
- rm
- touch
Correct Answer: 1
Explanation
The ls command is used to list files and directories in Linux. It can also be combined with options to display additional information. For example, ls -l shows permissions, ownership, file size, and modification time, while ls -a also displays hidden files. The cat command displays file contents, rm removes files, and touch creates an empty file or updates its timestamp. Learning basic commands such as ls is essential because administrators use them frequently when managing files and troubleshooting Linux systems.
Question 5
Which command is used to change the current directory in Linux?
- mv
- cd
- cp
- pwd
Correct Answer: 2
Explanation
The cd command is used to change the current working directory in Linux. For example, cd /var/log moves the user into the /var/log directory. Running cd .. moves one level up, while cd ~ usually moves to the user’s home directory. The mv command moves or renames files, cp copies files, and pwd shows the current directory. Understanding cd is important because many Linux commands work with relative paths based on the user’s current location.
Question 6
Which command is used to create a new empty file?
- mkdir
- touch
- rmdir
- grep
Correct Answer: 2
Explanation
The touch command can create a new empty file when the specified file does not already exist. For example, touch notes.txt creates an empty file named notes.txt. If the file already exists, touch normally updates its timestamp instead. The mkdir command creates directories, rmdir removes empty directories, and grep searches text for matching patterns. Administrators often use touch when preparing configuration files, scripts, test files, or placeholders during system administration and troubleshooting tasks.
Question 7
Which command is used to create a new directory?
- mkdir
- rmdir
- touch
- chmod
Correct Answer: 1
Explanation
The mkdir command creates a new directory in Linux. For example, mkdir backups creates a directory named backups in the current location. The -p option can be used to create parent directories when they do not already exist. The rmdir command removes empty directories, while touch creates files. The chmod command changes file or directory permissions. Directory management is a basic Linux administration task because administrators regularly organize application files, backups, logs, scripts, and user data.
Question 8
Which command is used to copy a file from one location to another?
- mv
- cp
- rm
- ln
Correct Answer: 2
Explanation
The cp command is used to copy files and directories in Linux. For example, cp file.txt /backup/ creates a copy of file.txt in the /backup directory. The original file remains in its original location. The mv command moves or renames files, while rm removes them. The ln command creates links. Copying files is useful for backups, testing configuration changes, and creating working copies before modifying important data. Administrators should still verify that copied files have the expected permissions and ownership.
Question 9
Which command is used to remove a file in Linux?
- delete
- erase
- rm
- remove
Correct Answer: 3
Explanation
The rm command is commonly used to remove files in Linux. For example, rm oldfile.txt removes the specified file. Administrators should use this command carefully because deleted files may not be easily recoverable, especially when no backup exists. Options such as -r can remove directories and their contents, making incorrect use potentially dangerous. The commands delete, erase, and remove are not standard Linux commands for normal file deletion. Before removing important data, administrators should confirm the file name, path, and backup status.
Question 10
Which command displays the contents of a text file directly in the terminal?
- cat
- mkdir
- chmod
- ps
Correct Answer: 1
Explanation
The cat command can display the contents of a text file directly in the terminal. For example, cat config.txt prints the file contents. It is useful for quickly checking small configuration files, scripts, or text files. For large files, commands such as less may be better because they allow the administrator to move through the content more easily. The mkdir command creates directories, chmod changes permissions, and ps displays process information. Administrators frequently inspect configuration and log files during troubleshooting.
Question 11
Which command is commonly used to view running processes?
- ps
- df
- du
- mount
Correct Answer: 1
Explanation
The ps command displays information about running processes. It can be used with different options to show processes belonging to the current user or processes running across the entire system. For example, ps aux is commonly used to display detailed information about many running processes. The df command shows filesystem space, du shows file and directory disk usage, and mount displays or manages mounted filesystems. Process information is important when investigating high CPU usage, stopped applications, or unexpected programs.
Question 12
Which command is commonly used to display available disk space on mounted filesystems?
- free
- df
- ps
- top
Correct Answer: 2
Explanation
The df command displays information about disk space used and available on mounted filesystems. Using df -h presents the values in an easier-to-read format such as GB or MB. This command is useful when a system reports that a filesystem is full or applications cannot create new files. The free command shows memory usage, ps shows processes, and top provides live process and resource information. Regular disk-space checks can help administrators identify storage problems before they affect applications or system services.
Question 13
Which command is commonly used to check memory usage in Linux?
- free
- df
- ls
- mount
Correct Answer: 1
Explanation
The free command displays information about system memory and swap usage. Running free -h presents the values in human-readable units, making the output easier to understand. Administrators can use this command when investigating applications that are running slowly, systems that are using excessive swap, or servers with limited available memory. The df command checks filesystem space, while ls lists files and mount manages or displays mounted filesystems. Memory information is one important part of Linux performance troubleshooting.
Question 14
Which command can be used to change file permissions in Linux?
- chown
- chmod
- passwd
- usermod
Correct Answer: 2
Explanation
The chmod command changes the permissions assigned to a file or directory. Linux permissions control whether users can read, write, or execute an object. For example, chmod 755 script.sh gives the owner full permissions while allowing group members and others to read and execute the file. The chown command changes ownership, while passwd changes a user’s password and usermod modifies user-account settings. Proper permissions are important because they help prevent unauthorized access or modification of important system and application files.
Question 15
Which command is used to change the owner of a file?
- chmod
- chgrp
- chown
- usermod
Correct Answer: 3
Explanation
The chown command changes the owner of a file or directory. It can also change the group ownership when the appropriate syntax is used. For example, chown alice report.txt changes the owner of report.txt to the user alice. The chmod command changes permissions, while chgrp specifically changes group ownership. usermod changes settings for a user account. Correct ownership is important because Linux uses ownership together with permissions to decide which users and groups can access or modify files.
Question 16
Which command is commonly used to search for a specific word or pattern inside text?
- grep
- mkdir
- chmod
- who
Correct Answer: 1
Explanation
The grep command searches text for a specified pattern. It is widely used when examining configuration files, scripts, and logs. For example, grep error /var/log/app.log can display lines containing the word error. Administrators can combine grep with other commands to filter large amounts of information quickly. mkdir creates directories, chmod changes permissions, and who displays logged-in users. Searching logs with grep is especially useful during troubleshooting because it helps administrators locate relevant messages without manually reading an entire file.
Question 17
Which Linux utility is commonly used to schedule a command to run automatically at specific times?
- cron
- grep
- ssh
- tar
Correct Answer: 1
Explanation
cron is commonly used to schedule recurring tasks on Linux systems. Administrators can create cron jobs to perform tasks such as backups, cleanup operations, reports, or maintenance scripts at specified times. The schedule is normally configured through a user’s crontab or system cron configuration. grep searches text, ssh provides secure remote access, and tar is used to create or extract archives. Automated scheduling reduces the need for administrators to perform repetitive tasks manually and helps ensure important maintenance activities happen consistently.
Question 18
Which command is commonly used to securely connect to a remote Linux server?
- ftp
- ssh
- telnet
- ping
Correct Answer: 2
Explanation
The ssh command provides secure remote access to another system using encrypted communication. Administrators commonly use SSH to manage Linux servers remotely, execute commands, transfer files through related tools, and perform troubleshooting. Unlike older protocols such as Telnet, SSH protects the session from simple network interception by encrypting the connection. ftp is primarily a file-transfer protocol, telnet is an older remote-access protocol without modern secure encryption, and ping is used to test network reachability rather than provide remote shell access.
Question 19
Which command is commonly used to view systemd service status?
- systemctl status
- service-list
- systemd-check
- statusctl
Correct Answer: 1
Explanation
The systemctl status command is used to view the current status of a systemd-managed service. For example, systemctl status ssh can show whether the SSH service is running and provide recent service messages. This is useful when troubleshooting services that fail to start or unexpectedly stop. Administrators can also use related systemctl commands to start, stop, enable, or disable services. The other commands listed are not standard systemd commands. Checking service status should normally be one of the first steps when investigating a service problem.
Question 20
Which Linux principle is most important when giving users access to system resources?
- Give every user full administrator access
- Give users only the permissions they need
- Disable all authentication
- Share one administrator account with everyone
Correct Answer: 2
Explanation
The principle of least privilege means users should receive only the permissions required to perform their assigned tasks. This reduces the possible damage caused by mistakes, compromised accounts, or unauthorized activity. Giving every user administrator access creates unnecessary security risk because any compromised account could potentially affect the entire system. Sharing administrator accounts also makes auditing difficult because actions cannot easily be tied to one individual. Applying least privilege helps Linux administrators maintain stronger security while still allowing users and applications to perform their required functions.