4 Jan # Quiz # Shift 2

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 Saurabh220837
S
Saurabh220837
Community Contributor
Quizzes Created: 1 | Total Attempts: 372
Questions: 17 | Attempts: 372

SettingsSettingsSettings
Programming Language Quizzes & Trivia

4 Jan # Quiz # Shift 2


Questions and Answers
  • 1. 

    What command do you have to use to go to the previous directory?

    • A.

      Cd ~

    • B.

      Cd ..

    • C.

      Cd -

    • D.

      Cd /

    Correct Answer
    C. Cd -
    Explanation
    To go to the previous directory, you need to use the "cd -" command. This command allows you to switch back to the directory you were previously in. It is a useful shortcut when navigating between directories, especially when you need to quickly switch between two directories.

    Rate this question:

  • 2. 

    The command to revoke read permission from owner of file is 

    • A.

      Chmod a-r

    • B.

      Chmod o-r

    • C.

      Chmod g-r

    • D.

      Chmod u-r

    Correct Answer
    D. Chmod u-r
    Explanation
    The command "chmod u-r" is used to revoke read permission from the owner of a file. The "u" in the command refers to the user, and the "-r" option indicates the removal of the read permission. This command specifically targets the owner of the file and removes their ability to read the file's contents.

    Rate this question:

  • 3. 

    Command to translate text from lower case to upper case letter is 

    • A.

      tr '[:upper:]' '[:lower:]'

    • B.

      tr '[:lower:]' '[:upper:]'

    • C.

      Replace '[:upper:]' '[:lower:]'

    • D.

      Replace '[:lower:]' '[:upper:]'

    Correct Answer
    B. tr '[:lower:]' '[:upper:]'
    Explanation
    The correct answer is "tr '[:lower:]' '[:upper:]'". This command uses the 'tr' utility in Unix to translate text from lower case to upper case letters. The '[:lower:]' specifies the set of lower case letters, and '[:upper:]' specifies the set of upper case letters. By using this command, any lower case letters in the text will be replaced with their corresponding upper case letters.

    Rate this question:

  • 4. 

    We need to use the ________ option in sort command to sort on a certain column.

    • A.

      -c

    • B.

      -k

    • C.

      -o

    • D.

      -n

    Correct Answer
    B. -k
    Explanation
    To sort on a certain column using the sort command, we need to use the "-k" option. The "-k" option allows us to specify the column number or range of columns to sort on. By using this option, we can ensure that the sort command organizes the data based on the specified column, making it easier to analyze and work with the data.

    Rate this question:

  • 5. 

    What does the following command would do -  cp ../file

    • A.

      Copies the file from current directory to parent directory

    • B.

      Copies the file from parent directory to its parent directory

    • C.

      Copies the file from parent directory to current directory

    • D.

      Error in the command

    Correct Answer
    C. Copies the file from parent directory to current directory
    Explanation
    The command "cp .. /file" is used to copy the file from the parent directory to the current directory. The ".." represents the parent directory, and "/file" specifies the file to be copied.

    Rate this question:

  • 6. 

    The command used to find the process running on a shell is -

    Correct Answer
    ps
    PS
    Explanation
    The command "ps" or "PS" is used to find the process running on a shell. It is a common command in Unix-like operating systems that displays information about the currently running processes. By executing this command, users can view details such as process ID (PID), CPU and memory usage, and other relevant information. The "ps" command is essential for system administrators and users to monitor and manage processes effectively.

    Rate this question:

  • 7. 

    Which command is used to sort the lines of data in a file in reverse order

    • A.

      Sort -r

    • B.

      Sort --reverse

    • C.

      Reverse

    • D.

      -r

    Correct Answer
    A. Sort -r
    Explanation
    The correct answer is "sort -r". The "sort -r" command is used to sort the lines of data in a file in reverse order. The "-r" flag stands for reverse, indicating that the sorting should be done in descending order instead of the default ascending order. This command is commonly used in Unix-like operating systems to arrange data in reverse order based on a specific criterion, such as alphabetical order or numerical value.

    Rate this question:

  • 8. 

    Which command is used to extract specific columns from the file?

    • A.

      Cat

    • B.

      Cut

    • C.

      Grep

    • D.

      Extract

    Correct Answer
    B. Cut
    Explanation
    The command "cut" is used to extract specific columns from a file. It allows users to select specific fields or columns from a file or input stream and display them. This can be useful for extracting specific data or information from a large dataset or file.

    Rate this question:

  • 9. 

    By default, how many lines does head show

    Correct Answer
    10
    Explanation
    The default behavior of the "head" command in most operating systems is to display the first 10 lines of a file. This means that when you run the "head" command without specifying a number of lines, it will show you the first 10 lines of the file.

    Rate this question:

  • 10. 

    Which command is used to remove the read permission of the file 'note' from both the group and others?

    • A.

      Chmod go+r note

    • B.

      Chmod go+rw note

    • C.

      Chmod go-x note

    • D.

      Chmod go-r note

    Correct Answer
    D. Chmod go-r note
    Explanation
    The command "chmod go-r note" is used to remove the read permission of the file 'note' from both the group and others. This command changes the permissions of the file by removing the read permission (r) for both the group (g) and others (o).

    Rate this question:

  • 11. 

    Command to erase all files in the current directory, including all its sub-directories, using only one command?

    • A.

      Rm -r *

    • B.

      Rm

    • C.

      Rm -v

    • D.

      Rm

    Correct Answer
    A. Rm -r *
    Explanation
    The correct answer is "rm -r *". This command uses the "rm" command with the "-r" option to recursively remove all files and directories in the current directory. The "*" wildcard is used to match all files and directories in the current directory, including its sub-directories. This command effectively erases all files in the current directory and its sub-directories in one command.

    Rate this question:

  • 12. 

    The command used to list all files in a directory

    Correct Answer
    ls
    LS
    Explanation
    The command "ls" is used to list all files in a directory. It is case-sensitive, so both "ls" and "LS" are correct answers.

    Rate this question:

  • 13. 

    How can Piping be represented by a character.

    • A.

      $

    • B.

      |

    • C.

      ?

    • D.

      >>

    Correct Answer
    B. |
    Explanation
    The character "|" can represent piping in a command line or programming language. Piping allows the output of one command to be used as the input of another command. The "|" character is used to connect the output of one command to the input of another command, creating a flow of data between them. This allows for the chaining of commands together, enabling more complex and powerful operations to be performed.

    Rate this question:

  • 14. 

    Which of this is not the use of cat command --

    • A.

      Display content of a file

    • B.

      Write to a file

    • C.

      List a file

    • D.

      Append to a file

    Correct Answer
    C. List a file
    Explanation
    The cat command is primarily used to display the content of a file, write to a file, and append to a file. However, it cannot be used to directly list the contents of a file. To list the contents of a file, the ls command is typically used.

    Rate this question:

  • 15. 

    Command to find the current working directory is 

    • A.

      Cwd

    • B.

      Pwd

    • C.

      Cd

    • D.

      Mkdir

    Correct Answer
    B. Pwd
    Explanation
    The correct answer is "pwd". The "pwd" command stands for "print working directory" and is used to display the current working directory in the command line interface. It is a useful command when navigating through directories or when you need to know the exact location of your current 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 18, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 04, 2018
    Quiz Created by
    Saurabh220837
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.