Unix mcq Questions and Answers

unix mcq questions and answers, unix mcq questions tcs, unix mcq questions, mcq on unix operating system, unix mcq tcs xplore, unix mcq questions tcs xplore, unix mcq questions, unix mcq, unix mcq questions tcs opa, unix mcq pdf, unix operating system mcq, unix operating system mcq questions and answers, unix interview questions, vi editor mcq, unix mcq questions tcs,

40 most important UNIX mcq question and answers are listed below. Practicing those can help you to crack unix mcq online test, unix mcq tcs xplore & other exams.

1. Which of the following is not a UNIX shell
bash
wash
ksh
csh

Advertisement

wash

Q. 2. Which of the following is not a bash shell feature?
command line editing
command history navigation
Command separation
None of these

Command separation

Q. 3. Which shell command enables editing commands in vi mode?
set -o vi
set +o vi
enable -vi
enable +vi

Advertisement

set -o vi

Q. 4. Which shell programming construct would be best for writing a menu driven shell script?
case
if
test
for

Advertisement

case

Q. 5. Which special parameter used to store all the arguments passed to a shell script as a single string in a variable?
“$0”
[email protected]
“$#”
“$*”

“$*”

Advertisement

Q. 6. Which bash command is used to create shortcut names for long commands?
alias
short
bit.ly
ln

alias

Q. 7. Which of the following is a valid user-defined shell variable?
%age
 _var
#tag
.hidden

Advertisement

 _var

Q. 8. Which of the following is not a feature of any UNIX shell?
Programming constructs
command history navigation
command line editing
compilation

Advertisement

compilation

Q. 9. Which pair of characters would one use to store the output of a command into a shell variable?
Pair of single quotes
Pair of back ticks
Pair of double quotes
Pair of square brackets

Advertisement

Pair of back ticks

Q. 10. Which shell keyword used for skiping subsequent commands in a loop and move to the next iteration?
continue
break
goto
done

Advertisement

continue

Q. 11. Which metacharacter should be used to create a default label in case construct?
*
d*
$
$*

*

Q. 12. What is the first line in a well written Bash Shell Script?
#!/usr/bin/bash
# Filename :
#bash
#Shell script

Advertisement

#!/usr/bin/bash i.e. The bash interpreter line

Q. 13. Which of the following is not a Shell keyword
fi
esac
od
elif

Advertisement

od

Q. 14. Which environment variable contains the name of the shell that I am using in UNIX?
$shell
$SHELL
$Shell
$SHLL

Advertisement

$SHELL

Q. 15. Which command is used to remove the values stored in a shell variable?
rm
unset
rmdir
mv

unset

Advertisement

Q. 16. What are the first 2 characters of the first line of every shell script?
#!
!#
!!
##

#!

Advertisement

Q. 17. Which positional parameter contains the name of the shell script?
$0
$NAME
$SHELL
$#

$0

Q. 18. What symbol should I use to check if two strings are equal?
-eq
==
=
!=

Advertisement

==

Q. 19. Which of the following is not a valid keyword to be used for an if block in shell scripting?
else
done
then
fi

Advertisement

done

Q. 20. Which of the following is an invalid keyword for a “while” loop construct in shell programming?
continue
in
break
do

Advertisement

in

Q. 1. Which command would you use to find a file that contains your name?
vi
find
cat
grep

grep

Q. 2. Which redirection operator syntax should I use to safely redirect both stderr and stdout to the same file?
1>2
2>1
2>&1
1&&2

Advertisement

2>&1

Q. 3. What happens if I first redirect stdout to a file and then redirect stderr to the same file?
File only contains output of stdout
File is lost
File is overwritten by output of stdout
File is overwritten by output of stderr

File is overwritten by output of stderr

Q. 4. Which option of grep should I use to print only the names of files that contain a pattern I am interested in?
-o
-n
-v
-l

Advertisement

-l

Q. 5. Which regular expression matches all lines that end with s
s$
^s
s.
s*

s$

Q. 6. Which regular expression represents an empty line?
“ “
“^$”
“\n”
[:blank:]

Advertisement

“^$”

Q. 7. Which UNIX operator can I use to over write a file?
Input Redirection Operator
Append Operator
Redirection Operator
Minus Operator

Advertisement

Redirection Operator

Q. 8. What does the character class [:alpha:] represent?
All characters
All numbers
All alphabets and numbers
All ASCII alphabets

All ASCII alphabets

Q. 9. Which feature of UNIX helps in storing the output of a command for future reference?
Pipes
Multi tasking
Redirection
Filters

Advertisement

Redirection

Q. 10. Which UNIX command should I use to search for all java files in my Projects directory?
find -name “*.java” Projects
find -name “*.java”
find Projects -name “*.java”
find Projects “*.java”

find Projects -name “*.java”

Q. 11. What does the Regular Expression “[^a]b.” not match?
dba
bbc
cba
abc

abc

Q. 1. Which of the following is not a standard UNIX editor?
edx
vim
emacs
ed

edx

Q. 2. How many operations can you undo in vi editor?
zero
one
two
almost unlimited

Advertisement

almost unlimited

Q. 3. What command should I use to display line numbers for a file in vi editor?
:set display
:set linenu
:set nu
:set 1234

Advertisement

:set nu

Q. 4. Which key in vi editor will take me to Normal mode?
Esc
i
a
o

Advertisement

Esc

unix mcq questions and answers, unix mcq questions tcs, unix mcq questions, mcq on unix operating system, unix mcq tcs xplore, unix mcq questions tcs xplore, unix mcq questions, unix mcq, unix mcq questions tcs opa, unix mcq pdf, unix operating system mcq, unix operating system mcq questions and answers, unix interview questions, vi editor mcq, unix mcq questions tcs,

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top