04th
Aug
Unix MCQ

Unix MCQ

  • Admin
  • 04th Aug, 2020
  • 886 Followers

Unix MCQ Quiz

1) Which command is used to terminate a process?

  • A. kill
  • B. shutdown
  • C. cancel
  • D. haltsys

2) Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3?

  • A. chmod u+x emp[1-3]
  • B. chmod u+r ??? emp
  • C. chmod 222 emp?
  • D. chmod 777 emp*

3) To spawn a child of our own choice for running the script, we can use ........ command:

  • A. sh
  • B. ps
  • C. $$
  • D. pr

4) The first line in any shell script begins with a ......

  • A. $
  • B. #
  • C. !
  • D. &

5) Which of the following commands is used to display your working directory?

  • A. prompt $p$g
  • B. dir
  • C. path
  • D. pwd
Download Free : Unix MCQ PDF

6) The command used to compare the files is known as:

  • A. comp
  • B. ccp
  • C. cmp
  • D. do

7) A single read statement can be used with one or more variables:

  • A. True
  • B. False

8) Which command is used to display the top of the file?

  • A. head
  • B. grep
  • C. cat
  • D. more

9) To run the script, we should make it executable first by using ......

  • A. chmod +r
  • B. chmod +w
  • C. chmod +x
  • D. chmod +rwx

10) Shell scripts need to be saved with an extension .sh .

  • A. True
  • B. False

11) Which symbol will be used with grep command to match the pattern pat at the beginning of a line?

  • A. $pat
  • B. pat$
  • C. ^pat
  • D. pat^

12) The first argument is read by the shell into the parameter .......

  • A. $$
  • B. 1$
  • C. $3
  • D. $1

13) The second set of the three permissions (r-) indicates that:

  • A. other has read permission only
  • B. group has write permission only
  • C. group has read permission only
  • D. owner has read permission only

14) The complete set of positional parameters is stored in ......... as a single string:

  • A. $*
  • B. $n
  • C. $#
  • D. $$

15) Shell scripts are executed in a separate child shell process:

  • A. True
  • B. False

16) The field separator in cut command is specified with:

  • A. -x option
  • B. -r option
  • C. -d option
  • D. -a option

17) read command is shell’s internal tool:

  • A. True
  • B. False

18) The % key allows you:

  • A. to move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace.
  • B. to move the cursor to the first column in the current line
  • C. to move the cursor to the upperleft corner of the screen
  • D. to move the cursor backward to the beginning of a word

19) Which column contains all details of the permissions of a file when you issue the ls -l command?

  • A. first
  • B. second
  • C. third
  • D. fourth

20) Which command is used for making the scripts interactive?

  • A. write
  • B. ip
  • C. input
  • D. read

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

  • A. st
  • B. sort -r
  • C. sort
  • D. sh

22) The cp command uses:

  • A. standard input file
  • B. standard output file
  • C. neither standard input nor standard output file
  • D. both input and output file

23) ........can talk to the kernel:

  • A. Shell script
  • B. System instruction
  • C. Shell
  • D. System calls

24) Which command is used to copy all files having the string chap and any two characters after that to the progs directory?

  • A. cp chap* progs
  • B. cp chap?? /progs/*
  • C. cp chap?? progs
  • D. cp chap[12] /progs/*.*

25) While working with mail command, which command is used to save mail in a separate file?

  • A. r
  • B. d
  • C. s
  • D. w

26) What is a shell script?

  • A. a file containing a series of commands
  • B. a file containing special symbols
  • C. group of functions
  • D. group of commands

27) Which of the following is used for storing the number of positional parameters?

  • A. $*
  • B. $n
  • C. $2
  • D. $#

28) What are positional parameters?

  • A. pattern matching parameters
  • B. special variables and patterns
  • C. special variables for assigning arguments from the command line
  • D. special variables for reading user input

29) Which command is used to display and create files?

  • A. vi
  • B. cat
  • C. lyrix
  • D. ed

30) Which of the following directories contain all the Alias created by a user, including his login directory?

  • A. /usr
  • B. /tmp
  • C. /etc
  • D. /dev

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Dec
Laravel MCQ
01st
Dec
React JS MCQ
01st
Jan
AngularJs MCQ
01st
Jul
Node js MCQ
01st
Jul
Angular 2 MCQ
01st
Jul
JSON MCQ