Which command is used to show the current disk space usage in human-readable format?
Correct answer:
A) df -h
Explanation: The df -h command shows the disk space usage in a human-readable format, where sizes are displayed in KB, MB, or GB.
Which command is used to show the current disk space usage in human-readable format?
Correct answer:
A) df -h
Explanation: The df -h command shows the disk space usage in a human-readable format, where sizes are displayed in KB, MB, or GB.
What is the purpose of the uname command in Linux?
Correct answer:
A) Displays system information
Explanation: The uname command displays system information, including the kernel version and architecture.
Which of the following commands is used to install software packages in Debian-based systems?
Correct answer:
A) apt-get install
Explanation: The apt-get install command is used in Debian-based Linux distributions to install software packages.
How can you view the contents of a text file in Linux?
Correct answer:
A) cat
Explanation: The cat command displays the contents of a text file in the terminal.
What does the tail -f command do?
Correct answer:
A) Follows the changes to a file in real-time
Explanation: The tail -f command continuously displays the last lines of a file, updating as new lines are added.
Which command can be used to check the network connection status in Linux?
Correct answer:
A) ping
Explanation: The ping command is used to test the connectivity to another system or server by sending ICMP echo requests.
What does the locate command do in Linux?
Correct answer:
A) Finds files by name
Explanation: The locate command searches for files by name using a pre-built database.
How do you search for a file named file.txt in the current directory and its subdirectories?
Correct answer:
A) find . -name file.txt
Explanation: The find . -name file.txt command searches for a file named file.txt in the current directory and its subdirectories.
What does the useradd command do?
Correct answer:
A) Creates a new user
Explanation: The useradd command is used to create new user accounts in Linux.
Which command is used to remove a file in Linux?
Correct answer:
A) rm
Explanation: The rm command is used to remove files from the filesystem.
What does the touch command do in Linux?
Correct answer:
A) Creates a new empty file
Explanation: The touch command is used to create a new empty file or update the timestamp of an existing file.
Which command is used to add a user to a group in Linux?
Correct answer:
A) usermod -aG
Explanation: The usermod -aG command adds a user to a specified group, with the -aG option appending the user to the group without removing them from other groups.
How do you delete a directory in Linux, including its contents?
Correct answer:
A) rm -r
Explanation: The rm -r command recursively deletes a directory and all its contents.
What does the free -m command display?
Correct answer:
A) Memory usage in megabytes
Explanation: The free -m command displays memory usage in megabytes, showing total, used, and available memory.
Which command is used to compare two files in Linux?
Correct answer:
A) diff
Explanation: The diff command is used to compare two files line by line and highlight differences.
What does the history command do?
Correct answer:
A) Displays the list of previously executed commands
Explanation: The history command shows a list of commands that have been run in the current shell session.
Which command is used to reboot the system in Linux?
Correct answer:
B) shutdown -r
Explanation: The shutdown -r command reboots the system after shutting down all services and processes.
How can you display the manual page for a specific command in Linux?
Correct answer:
A) man
Explanation: The man command displays the manual page for any specified Linux command, providing usage information and options.
What does the chmod 644 command do?
Correct answer:
A) Sets read and write permissions for the owner, and read permissions for the group and others
Explanation: The chmod 644 command sets read and write permissions for the owner, and read-only permissions for the group and others.
Which command is used to display running processes in real-time?
Correct answer:
A) top
Explanation: The top command shows running processes in real-time, along with CPU and memory usage.
What does the alias command do in Linux?
Correct answer:
A) Creates shortcuts for commands
Explanation: The alias command is used to create shortcuts for longer or more complex commands.
Which command is used to find out the system uptime in Linux?
Correct answer:
A) uptime
Explanation: The uptime command shows how long the system has been running, along with the current time and load averages.
How can you check the status of a network interface in Linux?
Correct answer:
A) ifconfig
Explanation: The ifconfig command displays information about network interfaces, including IP addresses and connection status.
What does the cp command do in Linux?
Correct answer:
A) Copies files and directories
Explanation: The cp command is used to copy files and directories from one location to another.
Which command is used to display the current user's home directory?
Correct answer:
A) echo $HOME
Explanation: The echo $HOME command displays the home directory of the current user.
How can you display the IP address of a network interface in Linux?
Correct answer:
A) ip addr show
Explanation: The ip addr show command displays detailed information about all network interfaces, including IP addresses.
What is the use of the tar command in Linux?
Correct answer:
A) Creates or extracts archive files
Explanation: The tar command is used to create or extract archive files, often used with compression tools like gzip or bzip2.
Which command is used to show all open ports and services in Linux?
Correct answer:
A) netstat
Explanation: The netstat command shows all active connections, open ports, and services running on the system.
How do you check available disk space in Linux?
Correct answer:
A) df
Explanation: The df command displays available disk space on mounted file systems.
Which command is used to create a new directory in Linux?
Correct answer:
A) mkdir
Explanation: The mkdir command creates a new directory.
What does the passwd command do in Linux?
Correct answer:
A) Changes a user's password
Explanation: The passwd command is used to change a user's password.
Which command can be used to display the size of files and directories in Linux?
Correct answer:
A) du
Explanation: The du command displays the size of files and directories in the system.
How can you check the Linux kernel version?
Correct answer:
A) uname -r
Explanation: The uname -r command displays the version of the Linux kernel.
Which command is used to change file ownership in Linux?
Correct answer:
A) chown
Explanation: The chown command is used to change the ownership of files and directories.
What does the df command display in Linux?
Correct answer:
A) Disk space usage
Explanation: The df command shows the amount of disk space used and available on file systems.
Which command is used to install software packages in Red Hat-based Linux distributions?
Correct answer:
A) yum install
Explanation: The yum install command is used in Red Hat-based distributions to install software packages.
What does the ps command show?
Correct answer:
A) Running processes
Explanation: The ps command displays a snapshot of the currently running processes on the system.
Which command is used to forcefully remove a directory along with its contents?
Correct answer:
A) rm -rf
Explanation: The rm -rf command forcefully removes a directory and all its contents recursively.
What does the grep command do?
Correct answer:
A) Searches for patterns in files
Explanation: The grep command searches for specified patterns within files.
Which command is used to create a compressed .gz file?
Correct answer:
A) gzip
Explanation: The gzip command compresses files into .gz format.
How do you list all running services in Linux?
Correct answer:
A) systemctl list-units --type=service
Explanation: The systemctl list-units --type=service command lists all active services managed by systemd.
Which command is used to extract .tar.gz archive files?
Correct answer:
A) tar -xzvf
Explanation: The tar -xzvf command extracts files from a .tar.gz archive.
What does the chmod 755 command do?
Correct answer:
A) Gives read, write, and execute permissions to the owner, and read and execute permissions to others
Explanation: The chmod 755 command sets permissions so that the owner can read, write, and execute the file, while others can only read and execute it.
Which command is used to rename a file in Linux?
Correct answer:
A) mv
Explanation: The mv command is used to rename files or move them to a different directory.
What does the ln -s command do in Linux?
Correct answer:
A) Creates a symbolic link
Explanation: The ln -s command creates a symbolic link to a file or directory.
Which command is used to switch users in Linux?
Correct answer:
A) su
Explanation: The su command allows you to switch to another user account within the terminal session.
What does the uptime command display?
Correct answer:
A) How long the system has been running
Explanation: The uptime command shows how long the system has been running, along with the current load averages.
Which command shows the current working directory in Linux?
Correct answer:
A) pwd
Explanation: The pwd (print working directory) command displays the current directory the user is in.
What is the purpose of the export command in Linux?
Correct answer:
A) Exports environment variables to child processes
Explanation: The export command is used to set environment variables available to child processes.
Which command is used to display the manual page of a command?
Correct answer:
A) man
Explanation: The man command displays the manual page of a command, providing detailed usage instructions and options.
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.