Basic Unix Command Line Quiz

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 Ijstokes
I
Ijstokes
Community Contributor
Quizzes Created: 1 | Total Attempts: 6,605
Questions: 8 | Attempts: 6,624

SettingsSettingsSettings
Basic Unix Command Line Quiz - Quiz

A command line is sometimes referred to as a command screen and it is an interface used to type commands directly to a computer using a keyboard and not the mouse. Take the test below and see how much you understand the Unix command line and its uses. All the best!


Questions and Answers
  • 1. 

    How do you get help about the command cp?

    • A.

      Help cp

    • B.

      Man cp

    • C.

      Cp ?

    Correct Answer
    B. Man cp
    Explanation
    The correct answer is "man cp" because "man" is a command in Unix-like operating systems that is used to display the manual pages for a given command. In this case, "man cp" would display the manual page for the "cp" command, providing detailed information and instructions on how to use it.

    Rate this question:

  • 2. 

    How do you display a listing of file details such as date, size, and access permissions?

    • A.

      List all

    • B.

      Ls -full

    • C.

      Ls -l

    Correct Answer
    C. Ls -l
    Explanation
    The command "ls -l" is used to display a detailed listing of files, including their date of creation or modification, size, and access permissions. This command provides a comprehensive view of file details in a structured format, making it easier for users to analyze and manage their files.

    Rate this question:

  • 3. 

    How do you rename a file from new to old?

    • A.

      Mv new old

    • B.

      Cp new old

    • C.

      Rn new old

    Correct Answer
    A. Mv new old
    Explanation
    To rename a file from "new" to "old", the correct command is "mv new old". The "mv" command is used to move or rename files and directories in Unix-like operating systems. By specifying the current name of the file ("new") and the desired new name ("old"), the file is effectively renamed.

    Rate this question:

  • 4. 

    How do you display the contents of a file myfile.txt?

    • A.

      Type myfile.txt

    • B.

      List myfile.txt

    • C.

      Less myfile.txt

    • D.

      Cat myfile.txt

    Correct Answer
    C. Less myfile.txt
    Explanation
    D is also correct, however for large files C is preferred.

    Rate this question:

  • 5. 

    How do you create a new directory called flower?

    • A.

      Newdir flower

    • B.

      Mkdir flower

    • C.

      Crdir flower

    Correct Answer
    B. Mkdir flower
    Explanation
    The correct answer is "mkdir flower". This command is used to create a new directory in a file system. In this case, the directory is named "flower".

    Rate this question:

  • 6. 

    What is the command to search all files in your current directory for the word plasmodium?

    • A.

      Grep plasmodium *

    • B.

      Find plasmodium -all

    • C.

      Lookup plasmodium *

    Correct Answer
    A. Grep plasmodium *
    Explanation
    The correct answer is "grep plasmodium *". The "grep" command is used to search for a specific pattern or word in files. In this case, it will search for the word "plasmodium" in all files in the current directory. The "*" is a wildcard character that represents all files in the directory.

    Rate this question:

  • 7. 

    How do you print the first 15 lines of all files ending by .txt?

    • A.

      Print 15 .txt

    • B.

      Cat *.txt -length=15

    • C.

      Head -15 *.txt

    Correct Answer
    C. Head -15 *.txt
    Explanation
    The correct answer is "head -15 *.txt". The "head" command is used to print the first few lines of a file. By using the option "-15", it specifies that we want to print the first 15 lines. The "*.txt" part is a wildcard that matches all files ending with ".txt". Therefore, the command "head -15 *.txt" will print the first 15 lines of all files ending with ".txt".

    Rate this question:

  • 8. 

    Change the current directory to /usr/local/bin.

    • A.

      Mv /usr/local/bin

    • B.

      Cd /usr/local/bin

    • C.

      Setdir /usr/localbin

    Correct Answer
    B. Cd /usr/local/bin
    Explanation
    The correct answer is "cd /usr/local/bin". This command is used to change the current directory to /usr/local/bin. The "cd" command stands for "change directory" and is followed by the path of the directory you want to navigate to. In this case, it specifies the path /usr/local/bin as the new directory.

    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
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 30, 2010
    Quiz Created by
    Ijstokes
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.