Which command is used to move a file from one directory to another?
Correct answer:
A) mv
Explanation: The mv command is used to move files and directories from one location to another in the Linux file system.
Which command is used to move a file from one directory to another?
Correct answer:
A) mv
Explanation: The mv command is used to move files and directories from one location to another in the Linux file system.
Which command is used to create a new directory?
Correct answer:
B) mkdir
Explanation: The mkdir command is used to create new directories in the Linux file system.
What is the command used to remove a directory and all its contents?
Correct answer:
B) rm -r
Explanation: The rm -r command recursively removes a directory and all its files and subdirectories.
Which command is used to display the manual for a given command?
Correct answer:
A) man
Explanation: The man command is used to display the manual pages for other commands and applications in Linux.
How can a user search by keyword while using the man command?
Correct answer:
D) man /list
Explanation: Using /keyword in man pages allows a user to search for specific terms within the manual page.
Which command is used to clear all text from the terminal?
Correct answer:
A) clear
Explanation: The clear command clears the terminal screen of all text.
What is the default file permission for new directories in Linux?
Correct answer:
B) 755
Explanation: By default, new directories in Linux are created with 755 permissions, allowing the owner to read, write, and execute, while others can only read and execute.
What command is used to create an empty file in Linux?
Correct answer:
B) touch
Explanation: The touch command is commonly used to create empty files or update file timestamps in Linux.
Which command displays the present working directory?
Correct answer:
A) pwd
Explanation: The pwd command outputs the full directory path of the current working directory.
How do you display a list of all files, including hidden files, in a directory?
Correct answer:
A) ls -a
Explanation: The ls -a command lists all files in the directory, including hidden files, which start with a period (.).
Which command is used to search for a specific keyword in the output of other commands?
Correct answer:
A) grep
Explanation: The grep command searches for patterns in the output of other commands or within files.
What does the rmdir command do?
Correct answer:
B) Removes an empty directory
Explanation: The rmdir command only removes empty directories; it cannot delete directories that contain files.
Which of the following is a valid meta-character in Linux used for file matching?
Correct answer:
C) *
Explanation: The asterisk * is used as a wildcard to match any number of characters in filenames or commands.
What does the cd .. command do?
Correct answer:
B) Changes to the parent directory
Explanation: The cd .. command moves the user up one level to the parent directory.
Which command is used to rename a file or directory in Linux?
Correct answer:
B) mv
Explanation: The mv command can be used to move or rename files and directories.
What is the correct file extension for a GZIP compressed file?
Correct answer:
B) .gz
Explanation: Files compressed with the GZIP utility have the .gz extension.
What does the chmod command do?
Correct answer:
C) Changes file permissions
Explanation: The chmod command modifies the file permissions for the owner, group, and others.
What does the find command do in Linux?
Correct answer:
B) Searches for files matching specific criteria
Explanation: The find command searches for files and directories based on name, size, date, and other attributes.
Which command is used to display system information such as uptime and load?
Correct answer:
D) uptime
Explanation: The uptime command shows how long the system has been running along with the average system load.
What does the df command show?
Correct answer:
A) Disk space usage
Explanation: The df command shows how much disk space is used and available on each mounted filesystem.
What does the rm command do?
Correct answer:
A) Removes a file or directory
Explanation: The rm command is used to delete files or directories. The -r option allows recursive deletion of directories.
Which command is used to copy files in Linux?
Correct answer:
B) cp
Explanation: The cp command is used to copy files and directories from one location to another.
What is the purpose of the ls command in Linux?
Correct answer:
A) To list files and directories
Explanation: The ls command displays the contents of a directory.
Which command allows you to view the contents of a file one page at a time?
Correct answer:
D) less
Explanation: The less command is used to view the contents of a file one page at a time, allowing for easier navigation.
Which of the following is a text editor in Linux?
Correct answer:
A) vi
Explanation: vi is a text editor in Linux used for creating and editing text files.
What does the pwd command show?
Correct answer:
A) The current working directory
Explanation: The pwd command outputs the full directory path of the current location in the file system.
Which command is used to change the current directory?
Correct answer:
B) cd
Explanation: The cd command is used to navigate between directories in Linux.
What is the purpose of the chmod command in Linux?
Correct answer:
A) To change file permissions
Explanation: The chmod command is used to modify the permissions of a file or directory.
Which command is used to count the lines, words, and characters in a file?
Correct answer:
B) wc
Explanation: The wc command is used to count the number of lines, words, and characters in a file.
Which of the following is a wildcard character in Linux used to match multiple characters in filenames?
Correct answer:
C) *
Explanation: The asterisk * is a wildcard that matches any number of characters in filenames.
How can you append data to an existing file in Linux?
Correct answer:
B) >>
Explanation: The >> operator is used to append data to an existing file without overwriting its contents.
Which command can be used to search for a file by name in the current directory and its subdirectories?
Correct answer:
A) find
Explanation: The find command searches for files in a directory hierarchy based on criteria such as file name, size, and modification date.
What does the uname command display?
Correct answer:
A) System name and kernel version
Explanation: The uname command displays information about the system, including the kernel name and version.
Which of the following is the default shell in most Linux distributions?
Correct answer:
C) bash
Explanation: The Bourne Again Shell (bash) is the default shell in most Linux distributions.
Which of the following is NOT a package manager in Linux?
Correct answer:
D) DOS
Explanation: APT, YUM, and Pacman are package managers used in different Linux distributions. DOS is an old operating system.
What does the echo command do?
Correct answer:
A) Displays a line of text or variable value
Explanation: The echo command outputs a line of text or the value of a variable to the terminal.
What is the purpose of the ps command?
Correct answer:
A) To display a list of running processes
Explanation: The ps command shows information about active processes running on the system.
What does the tail command do?
Correct answer:
B) Displays the last 10 lines of a file
Explanation: The tail command shows the last 10 lines of a file by default.
Which command can you use to view system memory usage?
Correct answer:
B) free
Explanation: The free command provides information about the system's memory usage, including total, used, and free memory.
What is the role of the sudo command?
Correct answer:
A) To allow users to execute commands with superuser privileges
Explanation: The sudo command allows a permitted user to run a command as the superuser or another user, as specified by the security policy.
How can you list all the running services in a Linux system?
Correct answer:
C) systemctl list-units --type=service
Explanation: The systemctl command lists all the running services and their status.
What does the hostname command do?
Correct answer:
A) Displays or sets the system's hostname
Explanation: The hostname command shows or sets the system's hostname, which is used to identify the machine on the network.
Which command can be used to download and install updates on a Debian-based Linux system?
Correct answer:
A) apt-get update
Explanation: The apt-get update command is used in Debian-based distributions to update the package lists and install available updates.
Which command is used to view the contents of a file in Linux?
Correct answer:
A) cat
Explanation: The cat command is used to display the contents of a file on the terminal.
How can you remove a directory and all its contents, including subdirectories?
Correct answer:
A) rm -r
Explanation: The rm -r command removes a directory and all of its contents, including subdirectories, recursively.
What does the chown command do?
Correct answer:
A) Changes file or directory ownership
Explanation: The chown command changes the owner of a file or directory in Linux.
Which of the following commands will list hidden files in a directory?
Correct answer:
A) ls -a
Explanation: The ls -a command lists all files, including hidden files that begin with a period (.).
What is the primary purpose of the vi command?
Correct answer:
A) To edit text files
Explanation: vi is a text editor in Linux used for editing files in the terminal.
Which command will display the current shell being used?
Correct answer:
A) echo $SHELL
Explanation: The echo $SHELL command outputs the name of the shell that is currently being used.
How can you terminate a process in Linux?
Correct answer:
A) kill
Explanation: The kill command is used to terminate processes by sending a signal, usually SIGTERM, to a process.
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.