Basic Linux Commands Quiz: Test!

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Bmblrb1
B
Bmblrb1
Community Contributor
Quizzes Created: 1 | Total Attempts: 24,452
| Attempts: 24,456 | Questions: 36
Please wait...
Question 1 / 36
0 %
0/100
Score 0/100
1. Cd dir

Explanation

The command "cd dir" is used to change the current directory to the directory named "dir". It does not refer to renaming a file or creating a new directory.

Submit
Please wait...
About This Quiz
Basic Linux Commands Quiz: Test! - Quiz


Are you familiar with Linux Commands? Linus is an entire group of open sources Unix operating systems that are based on Linux Kernel. Linux commands may seem intimidating... see moreat first if you are not used to using the terminal. However, with concentration and dedication, they are relatively easy to learn. There are many commands for performing operations on the Linux system. Find out how much you know about Linux Commands with a little help from this quiz. see less

2. Cp file1 file2

Explanation

The given command "cp file1 file2" is used to copy the contents of "file1" and paste them into "file2". It does not move or delete any files. Therefore, the correct answer is "copy file1 to file2".

Submit
3. Ls -al

Explanation

The command "ls -al" is used to display a formatted listing of all files and directories in the current directory, including hidden files. The "-a" flag is used to show all files, including hidden files, and the "-l" flag is used to display the files in a long format, providing additional information such as permissions, owner, size, and modification date. Therefore, the correct answer is "formatted listing with hidden files".

Submit
4. Pwd

Explanation

The command "pwd" stands for "print working directory" and is used to display the current directory that the user is in. It does not create or update files, nor does it delete files. Its sole purpose is to provide information about the current directory.

Submit
5. Man command

Explanation

The correct answer is "show manual for command". The "man" command is used in Unix and Unix-like operating systems to display the manual pages for a specific command. By typing "man command" in the terminal, the user can access detailed information about the usage, options, and examples of the specified command. This helps users understand how to use the command effectively and troubleshoot any issues they may encounter.

Submit
6. Mkdir dir

Explanation

The correct answer is "create directory dir" because the command "mkdir dir" is used to create a new directory named "dir". The other options do not accurately describe the action of creating a directory.

Submit
7. Rm file

Explanation

The correct answer is "delete file" because the command "rm" is used to remove or delete a file in Unix-based operating systems. It is a commonly used command to permanently delete a file from the system.

Submit
8. Rm -r dir

Explanation

The given command "rm -r dir" is used to delete a directory named "dir". The "-r" option is used to recursively delete all the files and subdirectories within the specified directory. Therefore, the correct answer is "delete directory dir".

Submit
9. Touch

Explanation

The correct answer is "create or update file" because the action of "touch" in computing refers to creating a new file or updating the timestamp of an existing file. It does not involve deleting or moving a file.

Submit
10. Ps

Explanation

The correct answer is "display currenty active processes" because the question asks for a command that will show the currently active processes. The other options, "display date and time" and "show months calendar," do not fulfill this requirement.

Submit
11. Mv file1 file2

Explanation

The command "mv file1 file2" is used to rename or move "file1" to "file2". It does not delete any files or copy "file1" to "file2".

Submit
12. Which command is used to list all files and directories in the current directory in Linux?  

Explanation

pwd: This command stands for "print working directory" and is used to display the current directory path.

cd: This command stands for "change directory" and is used to change the current directory to a specified one.

ls: This command stands for "list" and is used to list all files and directories in the current directory.

rm: This command stands for "remove" and is used to delete files or directories.

The correct command to list all files and directories in the current directory is ls.

Submit
13. Head file

Explanation

The command "head file" is used to display the top 10 lines of a file. It is a command-line tool commonly used in Unix-like operating systems to view the beginning portion of a file. By default, it displays the first 10 lines of the specified file. This command is helpful when you want to quickly preview the contents of a file without having to open the entire file.

Submit
14. Uptime

Explanation

The correct answer is "show current uptime" because the command "uptime" is used to display the current uptime of a system. It provides information about how long the system has been running since it was last booted up or restarted. By using this command, users can quickly check the duration of the system's uptime without having to go through other commands or menus.

Submit
15. Tail file

Explanation

The correct answer is "show bottom 10 lines" because the command "tail" is used to display the last few lines of a file, and the instruction specifically asks for the bottom 10 lines.

Submit
16. Cp -r dir1 dir2

Explanation

The given command "cp -r dir1 dir2" is used to copy the contents of "dir1" to "dir2". The "-r" option is used to copy directories recursively, meaning it will copy all the files and subdirectories within "dir1" to "dir2". If "dir2" does not exist, it will be created during the copying process.

Submit
17. Cd

Explanation

The command "cd" is used to change the current directory in a command line interface. In this case, the correct answer suggests that the command "cd" should be used to change the current directory to the "home" directory. This means that the user wants to navigate to the "home" directory from their current location.

Submit
18. More file

Explanation

The correct answer is "show contents of files" because the question is asking for a command that will display the contents of files. The other options, "show top 10 lines" and "show bottom 10 lines," suggest commands that would only display a portion of the file, rather than the entire contents.

Submit
19. Ls

Explanation

The answer "directory listing" is correct because the command "ls" is used to display the contents of a directory. It provides a list of files and directories within the current directory.

Submit
20. Rm -f file

Explanation

The command "rm -f file" is used to forcefully remove a file. The "-f" flag stands for "force" and it allows the deletion of the file without prompting for confirmation. Therefore, the correct answer is "force remove file".

Submit
21. Whereis app

Explanation

The correct answer is "show possible locations of app". This option suggests that it will display the various locations where the app can be found or accessed. It implies that the user wants to know the possible locations of the app, which could be helpful if they are unable to locate it or want to ensure that it is installed in the correct place.

Submit
22. Finger user

Explanation

The command "finger user" is used to display information about a specific user. It provides details such as the user's login name, full name, login time, idle time, and terminal location. By executing this command, you can retrieve specific information about the user you are interested in.

Submit
23. Ping host

Explanation

The correct answer is "ping host and output results" because the command "ping" is used to check the connectivity between a source and a destination host. By specifying "host" after the ping command, it indicates that the user wants to test the connectivity with a specific host. Additionally, the phrase "and output results" suggests that the command should display the results of the ping test, allowing the user to see if there is a successful connection or any potential issues.

Submit
24. Kill all proc

Explanation

The correct answer is "kill all processes named proc" because it accurately describes the action of terminating all running processes that have the name "proc". The other options either do not specify the name of the processes to be killed or do not mention killing all processes.

Submit
25. Tar cf file.tar files

Explanation

The given command "tar cf file.tar files" creates a tar file named "file.tar" and includes the files specified in the command. The "c" option is used to create a new archive, and the "f" option is used to specify the name of the archive file. The "files" parameter represents the files that will be included in the tar file. Therefore, the command creates a tar file named "file.tar" containing the specified files.

Submit
26. Which of the following describes the function of setting an application as the default for certain actions in an operating system?

Explanation

Setting an application as the default means specifying which application automatically opens when performing a certain type of action, such as opening a web page or viewing a photo. This setting tells the operating system to always use the selected application to open all files of a particular type unless specified otherwise. The correct option, "Show which app will be run by default," directly addresses the function of default applications in managing file associations and ensuring a seamless user experience by automatically using the preferred app.

Submit
27. Whoami

Explanation

The given answer "who are you logged in as" is a possible response to the question "whoami". It is asking for the username or identity of the current user who is logged into the system.

Submit
28. Cal

Explanation

The correct answer is "show months calendar" because the word "cal" is a common abbreviation for "calendar." Therefore, when the user inputs "cal," the expected action would be to display the months calendar.

Submit
29. Tar xf file.tar

Explanation

The command "tar xf file.tar" is used to extract the files from a tar file named "file.tar". It does not create a tar file or specify any specific files to be included in the extraction.

Submit
30. Df

Explanation

The correct answer is "disk usage." This command is used to display the amount of disk space used by files and directories on a file system. It provides information about the total disk space, the amount of space used, and the amount of free space available. By using this command, users can easily identify which directories or files are taking up the most space on their disk and take appropriate actions to manage their storage efficiently.

Submit
31. Date

Explanation

The correct answer is "show date and time" because it is the option that includes both the date and the time. The other options only include either the month calendar or just the date. Therefore, "show date and time" is the most comprehensive choice that displays both the current date and time.

Submit
32. W

Explanation

The basic Linux command w is used to show who is online. It displays information about the users currently on the machine, along with their activities, including the login time, idle time, and the command they are currently executing.

Submit
33. Uname -a

Explanation

The correct answer is "show kernel information." The command "uname -a" is used to display detailed information about the kernel of the operating system, including the version, release, and other relevant information.

Submit
34. Top

Explanation

The correct answer is "display all running processes." This option suggests that the command or action will show a list of all the processes that are currently running on a system. This can be useful for monitoring system activity, identifying resource usage, and troubleshooting any issues related to specific processes. It allows users to get an overview of the processes that are running at a given time.

Submit
35. Free

Explanation

The correct answer is "show memory or swap usage" because the question is asking for a command that displays information about memory or swap usage. The other options mentioned, such as "show directory space usage" and "disk usage," are not relevant to the question as they pertain to different aspects of system monitoring.

Submit
36. Which of the following commands is used to display the current directory in Linux?

Explanation

ls: Lists directory contents.

cd: Changes the current directory.

pwd: Prints the current working directory.

mkdir: Creates a new directory.

Submit
View My Results

Quiz Review Timeline (Updated): Jun 13, 2025 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jun 13, 2025
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 07, 2011
    Quiz Created by
    Bmblrb1
Cancel
  • All
    All (36)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Cd dir
Cp file1 file2
Ls -al
Pwd
Man command
Mkdir dir
Rm file
Rm -r dir
Touch
Ps
Mv file1 file2
Which command is used to list all files and directories in the current...
Head file
Uptime
Tail file
Cp -r dir1 dir2
Cd
More file
Ls
Rm -f file
Whereis app
Finger user
Ping host
Kill all proc
Tar cf file.tar files
Which of the following describes the function of setting an...
Whoami
Cal
Tar xf file.tar
Df
Date
W
Uname -a
Top
Free
Which of the following commands is used to display the current...
Alert!

Advertisement