UNIX MCQ Questions. OS (Operating System) and commands related MCQs with answers PDF for all competitive exams like JECA, TCS IPA, TCS LIP, TCS PRA, AMDOCS, UGC NET, GATE etc.
UNIX MCQ Questions
1. A UNIX device driver is
A. Structured into two halves called top half and bottom half
B. Three equal partitions
C. Unstructured
D. None of the above
Ans. A
2. What is property of UNIX ?
a) Multi User
b) Multi Processes
c) Multi Tasking
d) All of above
Ans. D
3. Which of the following statement is FALSE ?
A. unix supports multiple users
B. linux is an open source operating system and the source code is shared
C. shell takes care of inter process communication
D. shell provides the feature of i/o redirection
Ans. C
4. Which of the following is not a feature of UNIX operating system?
a) Multiuser
b) Multitasking
c) Single tasking
d) Security
Ans. c
5. Which of the following is not true about UNIX?
a) Many people can use a UNIX based computer at the same time; hence UNIX is called as a multiuser system
b) A user can run multiple programs at the same time; hence UNIX is called a multitasking environment
c) UNIX was not written in ‘C’ language
d) Linux is also known as a version of UNIX
Ans. c
6. UNIX was one of the first operating systems to support _______.
(a) multi-tasking
(b) Internet
(c) email
(d) all of them
Ans. d
7. UNIX was developed in the year _______.
(a) 1970
(b) 1984
(c) 1985
(d) 1993
Ans. a
8. POSIX stands for _______.
(a) Power Operating System Interface
(b) Portable Operating System Interface
(c) Portable Operating System Internet
(d) Portable Overall System Interface
Ans. b
9. Early versions of UNIX supported a graphical user environment called _____.
(a) KDE
(b) CDE
(c) GNOME
(d) none of them
Ans. c
10. CDE stood for _____ .
(a) Common Desktop Environment
(b) Command Desktop Environment
(c) Common Desktop Entry
(d) Common Directory Environment
Ans. a
11. The advantage of binary files over text files is that
a) it is compact
b) it can be accessed faster
c) They are more reliable
d) All of these
Ans. d
12. Shell script is preferable to other forms of programming because it
a) Makes programming task easier
b) Enhances portability
c) Occupies less space
d) All of these
Ans. d
13. Choose the incorrect statements.
a) Shell scripts can accept arguments
b) Shell scripts are interpreted
c) Shell is a programming language
d) Shell scripts are compiled
Ans. d
14. cc command sequentially invokes
a) Preprocessor. Compiler and link editor
b) Compiler and link editor
c) Preprocessor, compiler. Assembler and link editor
d) Compiler, assembler and link editor
Ans. c
15. UNIX operating system was developed at _______
(a) AT&T Bell Labs
(b) Carnegie Milan University
(c) CERN
(d) NASA
Ans. a
16. Shell script need to be saved with an extension .sh
a) True
b) False
Ans. b
17. Shell scripts are executed in a separate child shell process.
a) True
b) False
Ans. a
18. The first line in any shell script begins with a ____
a) &
b) !
c) $
d) #
Ans. d
19. To spawn a child of our own choice for running the script, we can use ____ command.
a) ps
b) pr
c) sh
d) $$
Ans. c
20. Which command is used for making the scripts interactive?
a) ip
b) input
c) read
d) write
Ans. c
21. read command is shell’s internal tool.
a) True
b) False
Ans. a
22. A single read statement can be used with one or more variables.
a) True
b) False
Ans. a
23. What are positional parameters?
a) special variables for assigning arguments from the command line
b) pattern matching parameters
c) special variables for reading user input
d) special variables and patterns
Ans. a
24. The first argument is read by the shell into the parameter _____
a) 1$
b) $3
c) $$
d) $1
Ans. d
25. The complete set of positional parameters is stored in ____ as a single string.
a) $n
b) $#
c) $*
d) $$
Ans. c
26. Which of the following is used for storing the number of positional parameters?
a) $n
b) $#
c) $*
d) $2
Ans. b
27. 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^
Ans. a
28. Which command is used to sort the lines of data in a file in reverse order
a) sort
b) sh
c) st
d) sort –r
Ans. d
29. Which command is used to display the top of the file?
a) cat
b) head
c) more
d) grep
Ans. b
30. Which command is used to copy all files having the string cha and any two characters after that to the progs directory?
a) cp chap?? Progs
b) cp chap* progs
c) cp chap[12] /progs/*.*
d) cp chap?? /progs/*
Ans. a
31. Which command is used to change protection mode of files starting with the string emp and ending with 1,2 or 3?
a) chmodu+xemp[1-3]
b) chmodu+r ??? emp
c) chmod 777 emp*
d) chmod 222 emp?
Ans. a
32. Which of the following keys is used to replace a single character with new text?
a) S
b) s
c) r
d) C
Ans. b
33. Which command is used to extract specific columns from the file?
a) cat
b) cut
c) grep
d) paste
Ans. b
34. Which command sends the word count of the file infile to the newfile.
a) wcinfile>newfile
b) wc<infile>newfile
c) wcinfile – newfile
d) wcinfile | newfile
Ans. a
35. Which command is used to remove thee read permission on the file ‘note’ from both the group and others?
a) chmodgo+r note
b) chmodgo+rw note
c) chmod go-x note
d) chmod go-r note
Ans. d
36. Which of the following files will displayed by this command cat *ch*
a) patch
b) catch
c) .ch
d) All of these
Ans. d
37. The Octal number to be given along with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is:
a) 000
b) 755
c) 744
d) 555
Ans. b
38. Which of the following keys is used to move the cursor to the end of the paragraph.
a) }
b) {
c) |
d) $
Ans. a
39. Which command is used to concatenate all files beginning with the string ‘emp’ and followed by a non-numeric characters?
a) catemp[!0-9]
b) more [emp][!0-9]
c) catemp[x-z]
d) cat emp[a-z]
Ans. a
40. The agency that sits between the user and the UNIX system is called the
a) logic
b) profile
c) shell
d) erxc
Ans. c