Which Linux command is used to print the last 10 lines of a file?
Correct answer:
A) tail
Explanation: The tail command prints the last 10 lines of a file by default.
Which Linux command is used to print the last 10 lines of a file?
Correct answer:
A) tail
Explanation: The tail command prints the last 10 lines of a file by default.
What does the tar command do in Linux?
Correct answer:
B) Creates an archive
Explanation: The tar command is used to create an archive of multiple files.
Which command is used to list open ports and network connections?
Correct answer:
A) netstat
Explanation: The netstat command displays open ports and active network connections.
What is the default text editor in most Linux distributions?
Correct answer:
A) vi
Explanation: The vi editor is the default text editor in most Linux distributions.
How do you search for a pattern within files in Linux?
Correct answer:
A) grep
Explanation: The grep command is used to search for patterns within files.
Which command is used to modify the default gateway in Linux?
Correct answer:
A) route
Explanation: The route command is used to modify or view the IP routing table, including the default gateway.
What does the mv command do?
Correct answer:
A) Move or rename files
Explanation: The mv command is used to move or rename files and directories.
Which of the following is a valid option for the cp command to copy directories recursively?
Correct answer:
A) -r
Explanation: The -r option allows the cp command to copy directories and their contents recursively.
Which of the following commands is used to display the system's IP routing table?
Correct answer:
D) All of the above
Explanation: All of these commands can display the system's IP routing table.
What does the du -sh command display?
Correct answer:
A) Disk usage of a directory in human-readable format
Explanation: The du -sh command shows the disk usage of a directory in a human-readable format like MB or GB.
Which command is used to terminate a process by specifying its PID?
Correct answer:
A) kill
Explanation: The kill command is used to terminate a process using its process ID (PID).
What does the ln -s command do in Linux?
Correct answer:
A) Creates a symbolic link
Explanation: The ln -s command creates a symbolic (soft) link to another file or directory.
Which file contains system-wide environment variables in Linux?
Correct answer:
A) /etc/environment
Explanation: The /etc/environment file contains system-wide environment variables.
Which command is used to compress files using the gzip algorithm?
Correct answer:
A) gzip
Explanation: The gzip command is used to compress files using the gzip algorithm.
What does the find command do in Linux?
Correct answer:
A) Search for files and directories
Explanation: The find command searches for files and directories based on specified conditions.
How can you change the password of a user account?
Correct answer:
A) passwd
Explanation: The passwd command is used to change the password of a user account.
Which command is used to show the current disk usage of directories and files?
Correct answer:
A) du
Explanation: The du command displays disk usage of directories and files.
What does the sudo command allow?
Correct answer:
A) Execute commands with superuser privileges
Explanation: The sudo command allows permitted users to execute commands as the superuser.
How do you view a file's permissions in Linux?
Correct answer:
A) ls -l
Explanation: The ls -l command displays a list of files and their permissions.
What is the purpose of the passwd file in Linux?
Correct answer:
A) Stores user account information
Explanation: The /etc/passwd file stores user account information, but not the actual passwords.
Which of the following commands is used to reboot the Linux system?
Correct answer:
D) All of the above
Explanation: All of these commands can be used to reboot the system.
Which command would you use to delete a directory that contains files?
Correct answer:
A) rm -r
Explanation: The rm -r command removes a directory and all its contents recursively.
How do you create a new directory in Linux?
Correct answer:
A) mkdir
Explanation: The mkdir command is used to create a new directory.
Which command lists all active processes running on a Linux system?
Correct answer:
D) All of the above
Explanation: The ps, top, and htop commands all display running processes, with varying levels of detail.
What does the locate command do?
Correct answer:
A) Finds files by searching a pre-built database
Explanation: The locate command searches for files using a pre-built index for faster results.
Which command is used to monitor system performance in real-time?
Correct answer:
A) top
Explanation: The top command shows real-time system performance, including CPU and memory usage.
Which command is used to set permissions on files or directories in Linux?
Correct answer:
A) chmod
Explanation: The chmod command is used to change the permissions of a file or directory.
How can you display the current users logged in to the system?
Correct answer:
D) All of the above
Explanation: The who, users, and w commands all display information about users currently logged in to the system.
Which command is used to extract files from a tar archive?
Correct answer:
A) tar -xvf
Explanation: The tar -xvf command extracts files from a tar archive.
Which command is used to print the path of the current directory?
Correct answer:
A) pwd
Explanation: The pwd command prints the current working directory.
Which command displays the available disk space on mounted filesystems?
Correct answer:
A) df
Explanation: The df command displays available disk space on all mounted filesystems.
Which file in Linux stores group information?
Correct answer:
A) /etc/group
Explanation: The /etc/group file stores information about user groups.
How do you check system uptime in Linux?
Correct answer:
A) uptime
Explanation: The uptime command shows how long the system has been running.
Which command is used to copy files and directories?
Correct answer:
A) cp
Explanation: The cp command is used to copy files and directories.
What does the head command do in Linux?
Correct answer:
A) Displays the first 10 lines of a file
Explanation: The head command displays the first 10 lines of a file by default.
Which command is used to shut down a Linux system?
Correct answer:
D) All of the above
Explanation: The shutdown, halt, and poweroff commands are all used to shut down a Linux system.
How do you extract a .tar.gz file in Linux?
Correct answer:
A) tar -xvzf
Explanation: The tar -xvzf command extracts files from a .tar.gz archive.
What does the chmod 755 filename command do?
Correct answer:
A) Assigns read, write, and execute permissions for the owner and read and execute permissions for others
Explanation: The chmod 755 command gives the owner full access and others read and execute permissions.
Which command displays information about the current Linux distribution?
Correct answer:
D) Both a and c
Explanation: The lsb_release -a and cat /etc/os-release commands provide information about the current Linux distribution.
How do you check memory usage in Linux?
Correct answer:
D) All of the above
Explanation: The free -h, df -h, and top commands can all display memory usage in different formats.
What does the df -h command display?
Correct answer:
A) Disk space usage in a human-readable format
Explanation: The df -h command shows disk space usage in a human-readable format like MB or GB.
Which command lists the contents of a directory?
Correct answer:
A) ls
Explanation: The ls command lists the files and directories in the current directory.
Which command is used to install software on a Debian-based system?
Correct answer:
A) apt-get install
Explanation: The apt-get install command is used to install software on Debian-based systems.
What does the top command display in Linux?
Correct answer:
A) System processes in real-time
Explanation: The top command shows system processes and resource usage in real-time.
How do you display the contents of a file in Linux?
Correct answer:
D) All of the above
Explanation: The cat, less, and more commands can all be used to display the contents of a file.
Which file in Linux contains the system's hostname?
Correct answer:
A) /etc/hostname
Explanation: The /etc/hostname file contains the system's hostname.
How do you display the current time and date in Linux?
Correct answer:
A) date
Explanation: The date command displays the current time and date in Linux.
Which command changes the ownership of a file?
Correct answer:
A) chown
Explanation: The chown command changes the ownership of a file or directory.
What does the ps -e command display?
Correct answer:
A) All running processes
Explanation: The ps -e command lists all running processes in the system.
How do you display the current shell in use?
Correct answer:
A) echo $SHELL
Explanation: The echo $SHELL command displays the current shell in use.
If this exam is giving you a hard time, let us be your helping hand. Contact us, and we'll provide the assistance you need to pass and move forward.