Download PDF
Free download in PDF Unix Objective Type Questions and Answers for competitive exams. These short objective type questions with answers are very important for Board exams as well as competitive exams. These short solved questions or quizzes are provided by Gkseries.
(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
(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
(25)
Which option is used for checking if the file exists or not?
[A]
-e
[B]
-a
[C]
-n
[D]
-f
(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
(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
(28)
____ option is used for checking whether a particular file is older than a specified file.
[A]
-ot
[B]
-nt
[C]
-old
[D]
-ef
(29)
To spawn a child of our own choice for running the script, we can use ___ command.
[A]
sh
[B]
$$
[C]
pr
[D]
ps
(30)
Which command is used for making the scripts interactive?
[A]
read
[B]
write
[C]
input
[D]
ip
31
The first argument is read by the shell into the parameter ___
[A]
$1
[B]
$$
[C]
$3
[D]
1$
32
The complete set of positional parameters is stored in ______ as a single string.
[A]
$*
[B]
$$
[C]
$#
[D]
$n
33
Which of the following is used for storing the number of positional parameters?
[A]
$#
[B]
$2
[C]
$*
[D]
$n
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
35
In a system, if 5 people are currently using the vi editor. then the number of corresponding processes will be
36
dev/null
[A]
Is the UNIX built-in dustbin
[B]
Has write permission for all
[C]
Is a file
[D]
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
39
/bin
[A]
Is a bucket for storing information
[B]
Has files in binary code
[C]
is a directory
[D]
Both (b) and (c)
40
Redirection in pipes can be achieved by using
[A]
>
[B]
>>
[C]
tee
[D]
lpr
Please share this page