What command is used to display the current working directory in Linux?
Correct answer:
A) pwd
Explanation: The pwd command shows the full path of the current directory where the user is located.
What command is used to display the current working directory in Linux?
Correct answer:
A) pwd
Explanation: The pwd command shows the full path of the current directory where the user is located.
Which command in Linux is used to remove an empty directory?
Correct answer:
A) rmdir
Explanation: The rmdir command removes an empty directory. To remove non-empty directories, rm -r is used.
What command is used to change file permissions in Linux?
Correct answer:
A) chmod
Explanation: The chmod command is used to modify the permissions of files and directories in Linux.
Which command is used to create an empty file in Linux?
Correct answer:
A) touch
Explanation: The touch command creates an empty file or updates the modification timestamp of an existing file.
What does the man command do in Linux?
Correct answer:
A) Displays the manual page for a command
Explanation: The man command shows the manual pages (documentation) for other commands in Linux.
What does the cd command do in Linux?
Correct answer:
A) Changes the current directory
Explanation: The cd command is used to change the current working directory to a specified directory.
What is the default text editor installed on most Linux systems?
Correct answer:
A) vi
Explanation: vi is the default text editor available on most Linux systems. Other editors like nano and vim are also common but may need to be installed.
How do you count the number of lines in a file in Linux?
Correct answer:
A) wc -l
Explanation: The wc -l command counts the number of lines in a file and displays the result.
What does the df command show in Linux?
Correct answer:
A) Disk space usage
Explanation: The df command displays information about the file system disk space usage, including available and used space.
Which command is used to show the running processes in Linux?
Correct answer:
A) ps
Explanation: The ps command provides information about the currently running processes, including their process IDs (PIDs).
How can you search for a string within a file in Linux?
Correct answer:
A) grep
Explanation: The grep command is used to search for specific patterns or strings within files.
Which command is used to view the first 10 lines of a file by default?
Correct answer:
A) head
Explanation: The head command outputs the first 10 lines of a file by default, though the number of lines can be adjusted with options.
What is the role of the kill command in Linux?
Correct answer:
A) To terminate a running process
Explanation: The kill command is used to send signals to processes, usually to terminate them.
Which of the following is a package manager for Debian-based systems?
Correct answer:
A) APT
Explanation: APT (Advanced Package Tool) is the package manager used for Debian-based Linux distributions such as Ubuntu.
What does the echo command do?
Correct answer:
A) Displays text or variable value
Explanation: The echo command is used to display a line of text or the value of a variable to the terminal.
Which of the following is the correct command to view the contents of a directory?
Correct answer:
A) ls
Explanation: The ls command lists the files and directories in the current or specified directory.
What is the purpose of the mv command in Linux?
Correct answer:
A) To move or rename files and directories
Explanation: The mv command is used to move or rename files and directories in Linux.
What does the free command show in Linux?
Correct answer:
A) Memory usage
Explanation: The free command displays information about the total, used, and available memory on the system.
How can you display hidden files in a directory?
Correct answer:
A) ls -a
Explanation: The ls -a command shows all files in a directory, including hidden files (which begin with a .).
What does the chmod 755 command do?
Correct answer:
A) Sets read, write, and execute permissions for the owner, and read and execute permissions for the group and others
Explanation: The chmod 755 command sets permissions for a file or directory, allowing the owner to read, write, and execute, and others to only read and execute.
Which command is used to change the ownership of a file?
Correct answer:
A) chown
Explanation: The chown command is used to change the ownership of a file or directory in Linux.
How do you create a new directory in Linux?
Correct answer:
A) mkdir
Explanation: The mkdir command creates a new directory at the specified location.
Which command is used to view the last 10 lines of a file in Linux?
Correct answer:
A) tail
Explanation: The tail command displays the last 10 lines of a file by default.
What does the passwd command do?
Correct answer:
A) Changes the user's password
Explanation: The passwd command allows users to change their password or update password-related information.
How can you view the file permissions of a file?
Correct answer:
A) ls -l
Explanation: The ls -l command displays the file permissions, owner, group, size, and other details of files in the directory.
What is the purpose of the hostname command?
Correct answer:
A) Displays or sets the system's hostname
Explanation: The hostname command is used to view or change the system's network hostname.
Which of the following is a compression tool in Linux?
Correct answer:
A) gzip
Explanation: gzip is a compression tool used to compress and decompress files in Linux.
How do you check the disk usage of a file or directory?
Correct answer:
A) du
Explanation: The du command displays the disk usage of files and directories.
What does the find command do in Linux?
Correct answer:
A) Searches for files and directories
Explanation: The find command is used to search for files and directories that match specific criteria.
How do you display the system's kernel version?
Correct answer:
A) uname -r
Explanation: The uname -r command displays the Linux kernel version currently running on the system.
What does the alias command do in Linux?
Correct answer:
A) Creates shortcuts for long commands
Explanation: The alias command is used to define or display command aliases, which are shortcuts for longer commands.
How do you view the manual pages for a command in Linux?
Correct answer:
A) man
Explanation: The man command displays the manual pages for Linux commands.
Which command is used to delete a directory and its contents recursively?
Correct answer:
A) rm -r
Explanation: The rm -r command deletes a directory and its contents recursively.
What does the uptime command show in Linux?
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 time and load averages.
How can you display all running services in Linux?
Correct answer:
A) systemctl list-units
Explanation: The systemctl list-units command lists all the active and inactive services (units) in a system running systemd.
Which command is used to change a user's shell?
Correct answer:
A) chsh
Explanation: The chsh (change shell) command allows you to change the login shell for a user.
What does the df -h command show?
Correct answer:
A) Human-readable disk space usage
Explanation: The df -h command shows disk space usage in human-readable format, using size units such as KB, MB, or GB.
Which command is used to compress a file using the bzip2 algorithm?
Correct answer:
A) bzip2
Explanation: The bzip2 command is used to compress files using the bzip2 compression algorithm.
How do you create a symbolic link in Linux?
Correct answer:
A) ln -s
Explanation: The ln -s command creates a symbolic link, which points to another file or directory.
What does the jobs command show?
Correct answer:
A) Lists all jobs in the current shell
Explanation: The jobs command displays the status of jobs started in the current shell session.
Which command can be used to display all network interfaces in Linux?
Correct answer:
A) ifconfig
Explanation: The ifconfig command displays information about network interfaces and their configuration.
What does the whoami command display?
Correct answer:
A) The current user's name
Explanation: The whoami command outputs the username of the current user.
Which of the following is a process monitoring tool in Linux?
Correct answer:
A) top
Explanation: The top command is a process monitoring tool that displays system information, including CPU and memory usage.
What does the history command do?
Correct answer:
A) Displays the list of previously executed commands
Explanation: The history command displays a list of commands previously executed by the user in the current shell.
Which command is used to view detailed information about the CPU?
Correct answer:
A) lscpu
Explanation: The lscpu command displays detailed information about the system's CPU architecture.
How can you list all installed packages on a Debian-based system?
Correct answer:
A) dpkg -l
Explanation: The dpkg -l command lists all installed packages on Debian-based Linux distributions.
Which command is used to set a delay before shutting down a Linux system?
Correct answer:
A) shutdown +m
Explanation: The shutdown +m command schedules a system shutdown after a specified number of minutes.
What is the purpose of the sudo command in Linux?
Correct answer:
A) Allows a permitted user to run a command as the superuser or another user
Explanation: The sudo command allows users to execute commands with elevated privileges (superuser or root) if they have the necessary permissions.
Which command shows active TCP connections in Linux?
Correct answer:
A) netstat
Explanation: The netstat command displays active network connections, including TCP and UDP ports in use.
How do you set file permissions in octal notation in Linux?
Correct answer:
A) chmod
Explanation: The chmod command is used to set file permissions in octal notation, where each digit represents read, write, and execute permissions for the owner, group, and others.
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.