Basic Linux Commands Quiz: Test!

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Bmblrb1
B
Bmblrb1
Community Contributor
Quizzes Created: 1 | Total Attempts: 17,383
Questions: 36 | Attempts: 17,500

SettingsSettingsSettings
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 at 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.


Questions and Answers
  • 1. 

    Ls

    • A.

      Change directory

    • B.

      Format listing with hidden files

    • C.

      Directory listing

    Correct Answer
    C. Directory listing
    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.

    Rate this question:

  • 2. 

    Ls -al

    • A.

      Create or update file

    • B.

      Change directory

    • C.

      Formatted listing with hidden files

    Correct Answer
    C. Formatted listing with hidden files
    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".

    Rate this question:

  • 3. 

    Pwd

    • A.

      Create or update file

    • B.

      Show current directory

    • C.

      Delete file

    Correct Answer
    B. Show current directory
    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.

    Rate this question:

  • 4. 

    Cd dir

    • A.

      Change directory to dir

    • B.

      Rename file

    • C.

      Make directory

    Correct Answer
    A. Change directory to 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.

    Rate this question:

  • 5. 

    Cd

    • A.

      Change to end

    • B.

      Change to home

    • C.

      Update file

    Correct Answer
    B. Change to home
    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.

    Rate this question:

  • 6. 

    Mkdir dir

    • A.

      Create file

    • B.

      Create directory dir

    • C.

      Modify directory

    Correct Answer
    B. Create directory 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.

    Rate this question:

  • 7. 

    Rm file

    • A.

      Delete file

    • B.

      Move file

    • C.

      Update file

    Correct Answer
    A. Delete 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.

    Rate this question:

  • 8. 

    Rm -r dir

    • A.

      Delete file

    • B.

      Update directory

    • C.

      Delete directory dir

    Correct Answer
    C. Delete directory 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".

    Rate this question:

  • 9. 

    Rm -f file

    • A.

      Force remove file

    • B.

      Remove file

    • C.

      Remove directory

    Correct Answer
    A. Force remove 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".

    Rate this question:

  • 10. 

    cp file1 file2

    • A.

      Copy file1 to file 2

    • B.

      Move file1 to file2

    • C.

      Delete file1 to file 2

    Correct Answer
    A. Copy file1 to file 2
    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".

    Rate this question:

  • 11. 

    cp -r dir1 dir2

    • A.

      Copy file 1 to file 2

    • B.

      Delete files 1 and 2

    • C.

      Copy dir1 to dir 2, create dir 2 if it doesn't exist

    Correct Answer
    C. Copy dir1 to dir 2, create dir 2 if it doesn't exist
    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.

    Rate this question:

  • 12. 

    mv file1 file2

    • A.

      Rename or move file 1 to file 2

    • B.

      Delete file 1 and file 2

    • C.

      Copy file 1 to file 2

    Correct Answer
    A. Rename or move file 1 to file 2
    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".

    Rate this question:

  • 13. 

    Touch

    • A.

      Delte file

    • B.

      Move file

    • C.

      Create or update file

    Correct Answer
    C. Create or update file
    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.

    Rate this question:

  • 14. 

    more file

    • A.

      Show top 10 lines

    • B.

      Show bottom 10 lines

    • C.

      Show contents of files

    Correct Answer
    C. Show contents of files
    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.

    Rate this question:

  • 15. 

    head file

    • A.

      Show contents of files

    • B.

      Show top 10 lines

    • C.

      Show bottom 10 lines

    Correct Answer
    B. Show top 10 lines
    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.

    Rate this question:

  • 16. 

    tail file

    • A.

      Show top 10 lines

    • B.

      Show bottom 10 lines

    • C.

      Show contents of files

    Correct Answer
    B. Show bottom 10 lines
    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.

    Rate this question:

  • 17. 

    ps

    • A.

      Display date and time

    • B.

      Show months calendar

    • C.

      Display currenty active processes

    Correct Answer
    C. Display currenty active processes
    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.

    Rate this question:

  • 18. 

    Top

    • A.

      Displays all running processes

    • B.

      Displays current active processes

    • C.

      Kills process

    Correct Answer
    A. Displays all running processes
    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.

    Rate this question:

  • 19. 

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

    • A.

      Pwd

    • B.

      Cd

    • C.

      Ls

    • D.

      Rm

    Correct Answer
    C. Ls
    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.

    Rate this question:

  • 20. 

    kill all proc

    • A.

      Display all running processes

    • B.

      Kill process

    • C.

      Kill all processes named proc

    Correct Answer
    C. Kill all processes named 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.

    Rate this question:

  • 21. 

    date

    • A.

      Show month calendar

    • B.

      Show date

    • C.

      Show date and time

    Correct Answer
    C. Show date and time
    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.

    Rate this question:

  • 22. 

    cal

    • A.

      Calculator

    • B.

      Show months calendar

    • C.

      Show date

    Correct Answer
    B. Show months calendar
    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.

    Rate this question:

  • 23. 

    uptime

    • A.

      Show time

    • B.

      Show current uptime

    • C.

      Show date

    Correct Answer
    B. Show current 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.

    Rate this question:

  • 24. 

    W

    • A.

      Who is online

    • B.

      Who are you logged in as

    • C.

      When is the date

    Correct Answer
    A. Who is online
    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.

    Rate this question:

  • 25. 

    whoami

    • A.

      Who is online

    • B.

      Who is the user

    • C.

      Who are you logged in as

    Correct Answer
    C. Who are you logged in as
    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.

    Rate this question:

  • 26. 

    finger user

    • A.

      Who are you logged in as

    • B.

      Display information about user

    • C.

      Who is online

    Correct Answer
    B. Display information about 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.

    Rate this question:

  • 27. 

    uname -a

    • A.

      Show name

    • B.

      Show kernal information

    • C.

      Show who is logged in

    Correct Answer
    B. Show kernal information
    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.

    Rate this question:

  • 28. 

    man command

    • A.

      Show manual for command

    • B.

      Command user

    • C.

      Change directory

    Correct Answer
    A. Show manual for 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.

    Rate this question:

  • 29. 

    df

    • A.

      Disk usage

    • B.

      Show directory space usage

    • C.

      Show memory or swap usage

    Correct Answer
    A. Disk usage
    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.

    Rate this question:

  • 30. 

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

    • A.

      Ls

    • B.

      Cd

    • C.

      Pwd

    Correct Answer
    C. Pwd
    Explanation
    ls: Lists directory contents.
    cd: Changes the current directory.
    pwd: Prints the current working directory.
    mkdir: Creates a new directory.

    Rate this question:

  • 31. 

    free

    • A.

      Show directory space usage

    • B.

      Disk usage

    • C.

      Show memory or swap usage

    Correct Answer
    C. Show memory or swap usage
    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.

    Rate this question:

  • 32. 

    whereis app

    • A.

      Show which app will be run by default

    • B.

      Change app

    • C.

      Show possible locations of app

    Correct Answer
    C. Show possible locations of 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.

    Rate this question:

  • 33. 

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

    • A.

      Show possible locations of app

    • B.

      Change app

    • C.

      Show which app will be run by default

    Correct Answer
    C. Show which app will be run by default
    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.

    Rate this question:

  • 34. 

    tar cf file.tar files

    • A.

      Create a tar file

    • B.

      Create a tar named file.tar containing files

    • C.

      Extract the files

    Correct Answer
    B. Create a tar named file.tar containing 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.

    Rate this question:

  • 35. 

    tar xf file.tar

    • A.

      Create a tar file

    • B.

      Extract the files

    • C.

      Create a tar named file.tar containing files

    Correct Answer
    B. Extract the files
    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.

    Rate this question:

  • 36. 

    ping host

    • A.

      Ping host and output results

    • B.

      Ping file

    • C.

      Ping server and output results

    Correct Answer
    A. Ping host and output results
    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.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Sep 16, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 07, 2011
    Quiz Created by
    Bmblrb1
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.