Unix MCQs (01-100)

Unix 200 MCQs | Unix Commands For Exam

  1. UNIX was originally developed at:
    A) MIT
    B) AT&T Bell Labs
    C) Microsoft
    D) IBM
    Answer: B

  2. UNIX is a:
    A) Single-user operating system
    B) Multi-user operating system
    C) Real-time system
    D) None
    Answer: B

  3. UNIX is written mostly in:
    A) C
    B) Assembly
    C) Pascal
    D) Java
    Answer: A

  4. The UNIX kernel is:
    A) Hardware
    B) Software
    C) Both
    D) None
    Answer: B

  5. The kernel interacts with:
    A) Hardware and shell
    B) User directly
    C) Application software only
    D) None
    Answer: A

  6. The shell in UNIX is:
    A) Command interpreter
    B) Kernel
    C) File manager
    D) Hardware driver
    Answer: A

  7. The core of UNIX operating system is:
    A) Kernel
    B) Shell
    C) Commands
    D) Utilities
    Answer: A

  8. Which of the following is not a UNIX shell?
    A) Bourne shell
    B) Korn shell
    C) PowerShell
    D) C shell
    Answer: C

  9. Command prompt for Bourne shell is:
    A) $
    B) #
    C) %
    D) >
    Answer: A

  10. UNIX file system is organized as a:
    A) Hierarchical tree
    B) Linear list
    C) Network model
    D) Flat model
    Answer: A

  1. Command to list files in a directory:
    A) ls
    B) list
    C) show
    D) dir
    Answer: A

  2. To change directory:
    A) cd
    B) chdir
    C) cdir
    D) path
    Answer: A

  3. To print working directory:
    A) pwd
    B) path
    C) showdir
    D) list
    Answer: A

  4. To create a new directory:
    A) mkdir
    B) makedir
    C) newdir
    D) createdir
    Answer: A

  5. To remove a directory:
    A) rmdir
    B) deldir
    C) removedir
    D) dirrm
    Answer: A

  6. Command to copy files:
    A) cp
    B) copy
    C) cpy
    D) dup
    Answer: A

  7. Command to move or rename files:
    A) mv
    B) move
    C) ren
    D) shift
    Answer: A

  8. Command to remove a file:
    A) rm
    B) del
    C) erase
    D) delete
    Answer: A

  9. To view contents of a file:
    A) cat
    B) view
    C) open
    D) print
    Answer: A

  10. To display file page by page:
    A) more
    B) cat
    C) show
    D) ls
    Answer: A

  1. To change file permissions:
    A) chmod
    B) chown
    C) perm
    D) modfile
    Answer: A

  2. To change file owner:
    A) chown
    B) chgrp
    C) own
    D) setowner
    Answer: A

  3. To change group ownership:
    A) chgrp
    B) chown
    C) grpown
    D) groupmod
    Answer: A

  4. Default file permissions are controlled by:
    A) umask
    B) chmod
    C) chown
    D) maskset
    Answer: A

  5. Permission value 777 means:
    A) Full permission for all
    B) No permission
    C) Read-only
    D) Execute-only
    Answer: A

  6. Permission value 644 means:
    A) Owner read/write, group/others read
    B) Owner full
    C) Group full
    D) All read/write
    Answer: A

  7. Execute permission on a directory allows:
    A) Entering the directory
    B) Deleting files
    C) Listing contents
    D) Editing files
    Answer: A

  8. Read permission on a directory allows:
    A) Listing directory contents
    B) Executing files
    C) Creating new files
    D) None
    Answer: A

  9. To view file permissions:
    A) ls -l
    B) cat -p
    C) chmod -v
    D) showperm
    Answer: A

  10. Superuser in UNIX is:
    A) root
    B) admin
    C) user1
    D) sys
    Answer: A

  1. Command to concatenate and display files:
    A) cat
    B) join
    C) paste
    D) show
    Answer: A

  2. To display first 10 lines of a file:
    A) head
    B) tail
    C) start
    D) less
    Answer: A

  3. To display last 10 lines of a file:
    A) tail
    B) head
    C) last
    D) showend
    Answer: A

  4. To count number of lines, words, and characters:
    A) wc
    B) count
    C) lines
    D) stats
    Answer: A

  5. To sort contents of a file:
    A) sort
    B) order
    C) seq
    D) arrange
    Answer: A

  6. To find difference between two files:
    A) diff
    B) cmp
    C) compare
    D) check
    Answer: A

  7. To compare binary files:
    A) cmp
    B) diff
    C) compare
    D) bdiff
    Answer: A

  8. To merge file contents line by line:
    A) paste
    B) join
    C) cat
    D) merge
    Answer: A

  9. To display unique lines:
    A) uniq
    B) sort -u
    C) Both A and B
    D) distinct
    Answer: C

  10. To find lines matching a pattern:
    A) grep
    B) find
    C) search
    D) awk
    Answer: A

  1. To list running processes:
    A) ps
    B) jobs
    C) top
    D) All of the above
    Answer: D

  2. To terminate a process:
    A) kill PID
    B) end PID
    C) stop PID
    D) exit PID
    Answer: A

  3. To suspend a job:
    A) Ctrl+Z
    B) Ctrl+C
    C) Ctrl+D
    D) Ctrl+X
    Answer: A

  4. To resume a stopped job:
    A) fg
    B) bg
    C) resume
    D) restart
    Answer: A

  5. To run a process in background:
    A) command &
    B) bg command
    C) run command
    D) background command
    Answer: A

  6. To view background jobs:
    A) jobs
    B) ps -b
    C) viewjobs
    D) listjobs
    Answer: A

  7. To schedule a command to run later:
    A) at
    B) cron
    C) schedule
    D) timer
    Answer: A

  8. To schedule recurring jobs:
    A) cron
    B) at
    C) repeat
    D) schedule
    Answer: A

  9. To view active cron jobs:
    A) crontab -l
    B) cron -v
    C) showcron
    D) listcron
    Answer: A

  10. To remove all cron jobs:
    A) crontab -r
    B) remove cron
    C) clearcron
    D) delcron
    Answer: A

    1. Default shell in most UNIX systems is:
      A) Bourne Shell (sh)
      B) Korn Shell (ksh)
      C) C Shell (csh)
      D) Bash
      Answer: A

    2. Command to check the shell used by a user:
      A) echo $SHELL
      B) shellname
      C) show shell
      D) whoami shell
      Answer: A

    3. Command to see all environment variables:
      A) env
      B) printenv
      C) set
      D) All of the above
      Answer: D

    4. To set an environment variable:
      A) export VAR=value
      B) set VAR=value
      C) put VAR=value
      D) declare VAR=value
      Answer: A

    5. To remove an environment variable:
      A) unset VAR
      B) export -d VAR
      C) remove VAR
      D) delete VAR
      Answer: A

    6. To check your login name:
      A) whoami
      B) logname
      C) user
      D) uname -u
      Answer: A

    7. To display all logged-in users:
      A) who
      B) users
      C) w
      D) All of the above
      Answer: D

    8. To display system name and version:
      A) uname -a
      B) sysver
      C) version
      D) showver
      Answer: A

    9. To print current date and time:
      A) date
      B) time
      C) showdate
      D) now
      Answer: A

    10. Command to display calendar:
      A) cal
      B) calendar
      C) showcal
      D) date -c
      Answer: A

    11. Symbol > is used for:
      A) Output redirection
      B) Input redirection
      C) Piping
      D) None
      Answer: A

    1. Symbol < is used for:
      A) Input redirection
      B) Output redirection
      C) Background execution
      D) Piping
      Answer: A

    2. Symbol >> is used to:
      A) Append output to file
      B) Overwrite file
      C) Merge files
      D) Compare files
      Answer: A

    3. Symbol | is used for:
      A) Pipe output of one command to another
      B) Redirect input
      C) Comment
      D) Break line
      Answer: A

    4. Command to suppress error messages:
      A) 2>/dev/null
      B) 1>/dev/null
      C) >/dev/null 2>&1
      D) Both A and C
      Answer: D

    5. To read input from keyboard:
      A) read variable
      B) input variable
      C) cat > file
      D) key variable
      Answer: A

    6. Standard input file descriptor:
      A) 0
      B) 1
      C) 2
      D) 3
      Answer: A

    7. Standard output file descriptor:
      A) 1
      B) 0
      C) 2
      D) 3
      Answer: A

    8. Standard error file descriptor:
      A) 2
      B) 0
      C) 1
      D) 3
      Answer: A

    9. Command to combine stdout and stderr:
      A) command >file 2>&1
      B) command 2>file
      C) command <file
      D) command | file
      Answer: A

    1. Default UNIX text editor:
      A) vi
      B) nano
      C) pico
      D) emacs
      Answer: A

    2. To open a file in vi:
      A) vi filename
      B) open filename
      C) edit filename
      D) vim filename
      Answer: A

    3. To enter insert mode in vi:
      A) i
      B) a
      C) o
      D) All of the above
      Answer: D

    4. To save and quit vi:
      A) :wq
      B) ZZ
      C) 😡
      D) All of the above
      Answer: D

    5. To quit vi without saving:
      A) :q!
      B) :q
      C) :exit
      D) :stop
      Answer: A

    6. To delete a single line in vi:
      A) dd
      B) dl
      C) x
      D) D
      Answer: A

    7. To delete from cursor to end of line:
      A) D
      B) x
      C) dl
      D) d$
      Answer: D

    8. To search text in vi:
      A) /text
      B) ?text
      C) Both A and B
      D) find text
      Answer: C

    9. To replace text in vi:
      A) :%s/old/new/g
      B) replace old new
      C) find old replace new
      D) :sub old new
      Answer: A

    10. To undo last change:
      A) u
      B) U
      C) :undo
      D) All of the above
      Answer: A

    1. Filter command to display lines with a pattern:
      A) grep
      B) find
      C) search
      D) awk
      Answer: A

    2. Command to substitute text using stream editor:
      A) sed
      B) awk
      C) grep
      D) tr
      Answer: A

    3. To print specific fields in a file:
      A) awk ‘{print $1}’
      B) cut -f1
      C) Both A and B
      D) paste
      Answer: C

    4. Command to remove control characters:
      A) tr -d
      B) rm -c
      C) del -cc
      D) strip
      Answer: A

    5. Command to translate lowercase to uppercase:
      A) tr a-z A-Z
      B) tr lower upper
      C) sed ‘s/a/A/’
      D) awk ‘{toupper}’
      Answer: A

    6. To split a file into parts:
      A) split
      B) cut
      C) divide
      D) chunk
      Answer: A

    7. To join files horizontally:
      A) paste
      B) join
      C) cat
      D) merge
      Answer: A

    8. To join files by common field:
      A) join
      B) paste
      C) merge
      D) cut
      Answer: A

    9. Command to sort lines:
      A) sort
      B) order
      C) seq
      D) arrange
      Answer: A

    10. To display only unique lines:
      A) uniq
      B) sort -u
      C) Both A and B
      D) distinct
      Answer: C

    1. Root directory symbol in UNIX:
      A) /
      B) ~
      C) \
      D) home
      Answer: A

    2. Home directory symbol:
      A) ~
      B) /
      C) .
      D) ..
      Answer: A

    3. Current directory symbol:
      A) .
      B) ..
      C) /
      D) ~
      Answer: A

    4. Parent directory symbol:
      A) ..
      B) .
      C) /
      D) ~
      Answer: A

    5. To display disk space usage:
      A) df
      B) du
      C) Both A and B
      D) ls -s
      Answer: C

    6. To display file system type:
      A) df -T
      B) mount
      C) cat /proc/filesystems
      D) All of the above
      Answer: D

    7. To check file system errors:
      A) fsck
      B) chkdsk
      C) diskfix
      D) verifyfs
      Answer: A

    8. To mount a device:
      A) mount
      B) attach
      C) connect
      D) link
      Answer: A

    9. To unmount a device:
      A) umount
      B) unmount
      C) detach
      D) remove
      Answer: A

    10. To list mounted file systems:
      A) mount
      B) df
      C) cat /etc/mtab
      D) All of the above
      Answer: D

Leave a Comment

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

You cannot copy content of this page

Scroll to Top