Unix MCQs (01-100)
Unix 200 MCQs | Unix Commands For Exam
UNIX was originally developed at:
A) MIT
B) AT&T Bell Labs
C) Microsoft
D) IBM
Answer: BUNIX is a:
A) Single-user operating system
B) Multi-user operating system
C) Real-time system
D) None
Answer: BUNIX is written mostly in:
A) C
B) Assembly
C) Pascal
D) Java
Answer: AThe UNIX kernel is:
A) Hardware
B) Software
C) Both
D) None
Answer: BThe kernel interacts with:
A) Hardware and shell
B) User directly
C) Application software only
D) None
Answer: AThe shell in UNIX is:
A) Command interpreter
B) Kernel
C) File manager
D) Hardware driver
Answer: AThe core of UNIX operating system is:
A) Kernel
B) Shell
C) Commands
D) Utilities
Answer: AWhich of the following is not a UNIX shell?
A) Bourne shell
B) Korn shell
C) PowerShell
D) C shell
Answer: CCommand prompt for Bourne shell is:
A) $
B) #
C) %
D) >
Answer: AUNIX file system is organized as a:
A) Hierarchical tree
B) Linear list
C) Network model
D) Flat model
Answer: A
Command to list files in a directory:
A) ls
B) list
C) show
D) dir
Answer: ATo change directory:
A) cd
B) chdir
C) cdir
D) path
Answer: ATo print working directory:
A) pwd
B) path
C) showdir
D) list
Answer: ATo create a new directory:
A) mkdir
B) makedir
C) newdir
D) createdir
Answer: ATo remove a directory:
A) rmdir
B) deldir
C) removedir
D) dirrm
Answer: ACommand to copy files:
A) cp
B) copy
C) cpy
D) dup
Answer: ACommand to move or rename files:
A) mv
B) move
C) ren
D) shift
Answer: ACommand to remove a file:
A) rm
B) del
C) erase
D) delete
Answer: ATo view contents of a file:
A) cat
B) view
C) open
D) print
Answer: ATo display file page by page:
A) more
B) cat
C) show
D) ls
Answer: A
To change file permissions:
A) chmod
B) chown
C) perm
D) modfile
Answer: ATo change file owner:
A) chown
B) chgrp
C) own
D) setowner
Answer: ATo change group ownership:
A) chgrp
B) chown
C) grpown
D) groupmod
Answer: ADefault file permissions are controlled by:
A) umask
B) chmod
C) chown
D) maskset
Answer: APermission value 777 means:
A) Full permission for all
B) No permission
C) Read-only
D) Execute-only
Answer: APermission value 644 means:
A) Owner read/write, group/others read
B) Owner full
C) Group full
D) All read/write
Answer: AExecute permission on a directory allows:
A) Entering the directory
B) Deleting files
C) Listing contents
D) Editing files
Answer: ARead permission on a directory allows:
A) Listing directory contents
B) Executing files
C) Creating new files
D) None
Answer: ATo view file permissions:
A) ls -l
B) cat -p
C) chmod -v
D) showperm
Answer: ASuperuser in UNIX is:
A) root
B) admin
C) user1
D) sys
Answer: A
Command to concatenate and display files:
A) cat
B) join
C) paste
D) show
Answer: ATo display first 10 lines of a file:
A) head
B) tail
C) start
D) less
Answer: ATo display last 10 lines of a file:
A) tail
B) head
C) last
D) showend
Answer: ATo count number of lines, words, and characters:
A) wc
B) count
C) lines
D) stats
Answer: ATo sort contents of a file:
A) sort
B) order
C) seq
D) arrange
Answer: ATo find difference between two files:
A) diff
B) cmp
C) compare
D) check
Answer: ATo compare binary files:
A) cmp
B) diff
C) compare
D) bdiff
Answer: ATo merge file contents line by line:
A) paste
B) join
C) cat
D) merge
Answer: ATo display unique lines:
A) uniq
B) sort -u
C) Both A and B
D) distinct
Answer: CTo find lines matching a pattern:
A) grep
B) find
C) search
D) awk
Answer: A
To list running processes:
A) ps
B) jobs
C) top
D) All of the above
Answer: DTo terminate a process:
A) kill PID
B) end PID
C) stop PID
D) exit PID
Answer: ATo suspend a job:
A) Ctrl+Z
B) Ctrl+C
C) Ctrl+D
D) Ctrl+X
Answer: ATo resume a stopped job:
A) fg
B) bg
C) resume
D) restart
Answer: ATo run a process in background:
A) command &
B) bg command
C) run command
D) background command
Answer: ATo view background jobs:
A) jobs
B) ps -b
C) viewjobs
D) listjobs
Answer: ATo schedule a command to run later:
A) at
B) cron
C) schedule
D) timer
Answer: ATo schedule recurring jobs:
A) cron
B) at
C) repeat
D) schedule
Answer: ATo view active cron jobs:
A) crontab -l
B) cron -v
C) showcron
D) listcron
Answer: ATo remove all cron jobs:
A) crontab -r
B) remove cron
C) clearcron
D) delcron
Answer: ADefault shell in most UNIX systems is:
A) Bourne Shell (sh)
B) Korn Shell (ksh)
C) C Shell (csh)
D) Bash
Answer: ACommand to check the shell used by a user:
A) echo $SHELL
B) shellname
C) show shell
D) whoami shell
Answer: ACommand to see all environment variables:
A) env
B) printenv
C) set
D) All of the above
Answer: DTo set an environment variable:
A) export VAR=value
B) set VAR=value
C) put VAR=value
D) declare VAR=value
Answer: ATo remove an environment variable:
A) unset VAR
B) export -d VAR
C) remove VAR
D) delete VAR
Answer: ATo check your login name:
A) whoami
B) logname
C) user
D) uname -u
Answer: ATo display all logged-in users:
A) who
B) users
C) w
D) All of the above
Answer: DTo display system name and version:
A) uname -a
B) sysver
C) version
D) showver
Answer: ATo print current date and time:
A) date
B) time
C) showdate
D) now
Answer: ACommand to display calendar:
A) cal
B) calendar
C) showcal
D) date -c
Answer: ASymbol
>is used for:
A) Output redirection
B) Input redirection
C) Piping
D) None
Answer: A
Symbol
<is used for:
A) Input redirection
B) Output redirection
C) Background execution
D) Piping
Answer: ASymbol
>>is used to:
A) Append output to file
B) Overwrite file
C) Merge files
D) Compare files
Answer: ASymbol
|is used for:
A) Pipe output of one command to another
B) Redirect input
C) Comment
D) Break line
Answer: ACommand to suppress error messages:
A) 2>/dev/null
B) 1>/dev/null
C) >/dev/null 2>&1
D) Both A and C
Answer: DTo read input from keyboard:
A) read variable
B) input variable
C) cat > file
D) key variable
Answer: AStandard input file descriptor:
A) 0
B) 1
C) 2
D) 3
Answer: AStandard output file descriptor:
A) 1
B) 0
C) 2
D) 3
Answer: AStandard error file descriptor:
A) 2
B) 0
C) 1
D) 3
Answer: ACommand to combine stdout and stderr:
A) command >file 2>&1
B) command 2>file
C) command <file
D) command | file
Answer: A
Default UNIX text editor:
A) vi
B) nano
C) pico
D) emacs
Answer: ATo open a file in
vi:
A) vi filename
B) open filename
C) edit filename
D) vim filename
Answer: ATo enter insert mode in
vi:
A) i
B) a
C) o
D) All of the above
Answer: DTo save and quit
vi:
A) :wq
B) ZZ
C) 😡
D) All of the above
Answer: DTo quit
viwithout saving:
A) :q!
B) :q
C) :exit
D) :stop
Answer: ATo delete a single line in
vi:
A) dd
B) dl
C) x
D) D
Answer: ATo delete from cursor to end of line:
A) D
B) x
C) dl
D) d$
Answer: DTo search text in
vi:
A) /text
B) ?text
C) Both A and B
D) find text
Answer: CTo replace text in
vi:
A) :%s/old/new/g
B) replace old new
C) find old replace new
D) :sub old new
Answer: ATo undo last change:
A) u
B) U
C) :undo
D) All of the above
Answer: A
Filter command to display lines with a pattern:
A) grep
B) find
C) search
D) awk
Answer: ACommand to substitute text using stream editor:
A) sed
B) awk
C) grep
D) tr
Answer: ATo print specific fields in a file:
A) awk ‘{print $1}’
B) cut -f1
C) Both A and B
D) paste
Answer: CCommand to remove control characters:
A) tr -d
B) rm -c
C) del -cc
D) strip
Answer: ACommand to translate lowercase to uppercase:
A) tr a-z A-Z
B) tr lower upper
C) sed ‘s/a/A/’
D) awk ‘{toupper}’
Answer: ATo split a file into parts:
A) split
B) cut
C) divide
D) chunk
Answer: ATo join files horizontally:
A) paste
B) join
C) cat
D) merge
Answer: ATo join files by common field:
A) join
B) paste
C) merge
D) cut
Answer: ACommand to sort lines:
A) sort
B) order
C) seq
D) arrange
Answer: ATo display only unique lines:
A) uniq
B) sort -u
C) Both A and B
D) distinct
Answer: C
Root directory symbol in UNIX:
A) /
B) ~
C) \
D) home
Answer: AHome directory symbol:
A) ~
B) /
C) .
D) ..
Answer: ACurrent directory symbol:
A) .
B) ..
C) /
D) ~
Answer: AParent directory symbol:
A) ..
B) .
C) /
D) ~
Answer: ATo display disk space usage:
A) df
B) du
C) Both A and B
D) ls -s
Answer: CTo display file system type:
A) df -T
B) mount
C) cat /proc/filesystems
D) All of the above
Answer: DTo check file system errors:
A) fsck
B) chkdsk
C) diskfix
D) verifyfs
Answer: ATo mount a device:
A) mount
B) attach
C) connect
D) link
Answer: ATo unmount a device:
A) umount
B) unmount
C) detach
D) remove
Answer: ATo list mounted file systems:
A) mount
B) df
C) cat /etc/mtab
D) All of the above
Answer: D