Linux Shell Commands Aptitude Questions and Answers

Linux Shell Commands Aptitude Questions and Answers: This section contains aptitude questions and answers on Linux Shell Commands.
Submitted by Nidhi, on May 20, 2020

This section contains Aptitude Questions and Answers on Linux Shell Commands.

1) Which of the following command is used to check a Linux command is a built-in shell command or external command?
  1. cmdtype
  2. type
  3. ctype
  4. commandtype

2) Which of the following commands are built-in shell commands in the Linux operating system?
  1. pwd
  2. cd
  3. export
  4. echo

Options:

  1. A and B
  2. C and D
  3. A, B, and C
  4. A, B, C, and D

3) Which of the following commands are external commands in the Linux operating system?
  1. cat
  2. file
  3. help
  4. man

Options:

  1. A and B
  2. C and D
  3. A, B, and D
  4. A, B, C, and D

4) Which of the following command is used to display the path of a command in the Linux File System?
  1. pcmd
  2. which
  3. pathcmd
  4. None of the above

5) Which of the following command is used to assign a new name to the Linux built commands?
  1. newcmd
  2. new
  3. alias
  4. aliasname

6) Which of the following command is used to enable the shell expansion?
  1. shell +x
  2. shell -x
  3. set -x
  4. set +

7) Which of the following operator is used to execute multiple commands in a single line?
  1. ;
  2. %
  3. &&
  4. ||

8) Which of the following command is used to remove an existing alias?
  1. rmalias
  2. unalias
  3. delalias
  4. ralials

9) Which of the following operator is used to comment lines in a shell script file?
  1. //
  2. \\
  3. /**/
  4. #

10) The alias created by "alias" command can be used after exiting from shell?
  1. Yes
  2. No

11) Which of the following operator is used to store the exit code of a previous command?
  1. $?
  2. %$
  3. ?&
  4. ?@

12) There are the following statements that are given below, which of them are correct about Globbing?
  1. The Globbing is used to recognize the wildcard characters and then expand them into path-name.
  2. The Globbing is also known as path-name expansion.
  3. The File Globbing is not supported by the Linux operating system.
  4. All the above

Options:

  1. A and B
  2. A and C
  3. A, B, and C
  4. D

13) There are the following statements that are given below, which of them are correct about Wildcards in the Linux operating system?
  1. Wildcards are the string patterns that contain some special characters.
  2. Wildcards are used to perform actions on one or more file that uses the same pattern.
  3. Linux shell used wildcard characters for globbing.
  4. All the above

Options:

  1. A and B
  2. A and C
  3. A, B, and C
  4. D

14) Which of the following characters are used for wildcards in the Linux operating system?
  1. ?
  2. *
  3. []
  4. <> 

Options:

  1. A and B
  2. A and C
  3. A, B, and C
  4. D

15) Which of the following command is used to display the last executed commands list?
  1. lastcmd
  2. last
  3. history
  4. chistory

16) Which of the following environment variable is used to specify the number of commands history in the current environment?
  1. $HISTSIZE
  2. $HISSIZE
  3. $HISTORYSIZE
  4. $HSIZE

17) Which of the following command is known as "bang bang" in the Linux operating system?
  1. ##
  2. $$
  3. !!
  4. @@

18) There are the following statements that are given below, which of them are correct about "bang bang" command in the Linux operating system?
  1. The "bang bang" command is used to remove commands history.
  2. The "bang bang" command is used to remove execute last executed command.
  3. The "bang bang" command is used to display the last login time of the current user.
  4. None of the above

19) Which command is used to execute a command based on the number assigned in the command history, here we denote command history number by N?
  1. !N
  2. #N
  3. $N
  4. !!N

20) Can we embed the new shell on the command line?
  1. Yes
  2. No





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.