Advertisement

Unix Quiz | Unix Objective Type Questions and Answers

Advertisement
Advertisement
Questions
21 What are positional parameters?
A special variables for assigning arguments from the command line
B special variables for reading user input
C pattern matching parameters
D special variables and patterns

Answer: special variables for assigning arguments from the command line
22 To run the script, we should make it executable first by using _____
A chmod +rwx
B chmod +r
C chmod +x
D chmod +w

Answer: chmod +x
Advertisement
23 What is a shell script?
A a file containing a series of commands
B group of functions
C a file containing special symbols
D group of commands

Answer: a file containing a series of commands
24 Which one of the following option is used for checking that the string is NULL string?
A -z
B -n
C -o
D -a

Answer: -z
25 Which option is used for checking if the file exists or not?
A -e
B -a
C -n
D -f

Answer: -e
26 Which of the following option is used for checking if the file is readable or not?
A -z
B -r
C -f
D -n

Answer: -r
27 To check if the file exists and is executable we have to use ___ option with test.
A -x
B -w
C -f
D -e

Answer: -x
28 ____ option is used for checking whether a particular file is older than a specified file.
A -ot
B -nt
C -old
D -ef

Answer: -ot
29 To spawn a child of our own choice for running the script, we can use ___ command.
A sh
B $$
C pr
D ps

Answer: sh
30 Which command is used for making the scripts interactive?
A read
B write
C input
D ip

Answer: read
31 The first argument is read by the shell into the parameter ___
A $1
B $$
C $3
D 1$

Answer: $1
32 The complete set of positional parameters is stored in ______ as a single string.
A $*
B $$
C $#
D $n

Answer: $*
33 Which of the following is used for storing the number of positional parameters?
A $#
B $2
C $*
D $n

Answer: $#
34 Which of the following option is used for checking if the file is writable or not?
A -n
B -w
C -f
D -e

Answer: -w
35 In a system, if 5 people are currently using the vi editor. then the number of corresponding processes will be
A 5
B 0
C 1
D 2

Answer: 5
36 dev/null
A Is the UNIX built-in dustbin
B Has write permission for all
C Is a file
D All of these

Answer: All of these
37 The permission bits of a file noname. can be set to _rws_ _x_ _x by the command.
A chmod 2711 noname
B chmod go -rw noname
C chmod 711 noname
D None of the above

Answer: None of the above
38 /bin/passwd has the user execution permission set to 's' because
A /etc/passwd is write protected
B It should allow users who don't have write permission to /etc/passwd to write to it
C This facility assigns to the user, permissions of the program owner. temporarily
D State Transition

Answer: All of these
39 /bin
A Is a bucket for storing information
B Has files in binary code
C is a directory
D Both (b) and (c)

Answer: Both (b) and (c)
40 Redirection in pipes can be achieved by using
A >
B >>
C tee
D lpr

Answer: tee

Important EBooks for Competitive Exams

VIEW ALL