0% found this document useful (0 votes)
68 views32 pages

Unix-Mcq QNS

The document provides answers and explanations for 76 multiple choice questions about various Unix/Linux commands and concepts. Key commands covered include ls, pwd, cmp, rm, grep, tar, netstat, cut, tail, chmod, kill, mount, and more. Overall the document serves as a review of important Unix commands and concepts.

Uploaded by

Sharron Rose H
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views32 pages

Unix-Mcq QNS

The document provides answers and explanations for 76 multiple choice questions about various Unix/Linux commands and concepts. Key commands covered include ls, pwd, cmp, rm, grep, tar, netstat, cut, tail, chmod, kill, mount, and more. Overall the document serves as a review of important Unix commands and concepts.

Uploaded by

Sharron Rose H
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

1.In which language UNIX is written?

a) C++
b) C
c) JAVA
d) Python

Ans:b

2.Which command is used for printing the current working


directory?
a) dir
b) HOME
c) cd
d) pwd

Ans:d

3.Which command is used for comparing two files?


a) comp
b) cmp
c) comm
d) diff

Ans:b

4. Which symbol is used to change permissions for hidden files


in Unix?
a) *
b) $
c) &
d) .
Ans:d
5.How can we escape to the UNIX shell without quitting vi
editor?
a) using ‘:sh’ command and using ctrl-Z
b) using ‘:sh’ command
c) using ctrl-Z
d) using ctrl-D

Ans:a

6.Which of the following command is used to create a child


shell?
a) sh
b) env
c) wait
d) fork

Ans:a

7.Which Unix command is used for counting words, lines, and


characters in a file?
a) wc
b) man
c) count
d) diff

Ans:a

8.Which command is used for acquiring superuser status?


a) su
b) pu
c) super
d) admn
Ans:a

9.Which of the following cannot be performed by cat


command?
a) appending files
b) deleting files
c) creating files
d) displaying files

Ans:b

10. In Unix, for what purpose bc command is used?


a) for copying files
b) as a process table viewer
c) as an editor
d) as a calculator
Ans:d

11.Which command is used to delete all files in a directory?


a) del *
b) rm *
c) mv *
d) rmdir *
Ans:b

12.Which part of the Unix operating system interacts with the


hardware?
a) Application program
b) Vi editor
c) Shell
d) Kernel
Ans:d

13.script command is used for___________


a) recording history
b) recording our session
c) recording passwords
d) recording scripts
Ans:b

14.Which command is used as an alternative to echo


command?
a) ls
b) printf
c) wc
d) ps
Ans:b

15.Which command is used for displaying date and calendar in


UNIX?
a) date and cal
b) DATE and CAL
c) date and calendar
d) dt and cl
Ans:a

16. To clear the screen in vi editor, _____ is used.


a) ctrl-h
b) ctrl-l
c) ctrl-p
d) ctrl-v
Ans:b

17.To quit vi editor without saving the buffer we can use


a) :q
b) :c
c) :w
d) :q!
Ans:d

18.Which of the following key is used to enter in ex-mode?


a) ESC
b) i
c) :
d) ;
Ans:c

19.Which one of the following command can delete a directory


which is not empty?
a) rm -r
b) rmdir
c) rm *
d) del *
Ans:a

20.Which command is used with vi editor to search a pattern in


the forward direction?
a) /
b) //
c) ?
d) ??
Ans:a

21.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

22.Which command is used to terminate a process?


a)shutdown
b)haltsys
c)cancel
d)kill
Ans:d

23.Which of the following commands is used to identify the


type of file by context?
a)ls
b)cat
c)file
d)more
Ans:c

24.Which command is used to display the characteristics


of a process?
a)pid
b)du
c)ps
d)au
Ans:c

25.Which command is used to display a file contents in


octal form?
a)cd
b)od
c)of
d)oct
Ans:b

26.What does the 'chmod 755 file.txt' command do?


a) Gives full permissions to the owner and read-only to
others
b) Gives read and execute permissions to everyone
c) Gives full permissions to the owner and read-only to
group and others
d) Gives read, write, and execute permissions to everyone
Ans:b

27.Which signal is typically sent to a process to terminate


it?
a) SIGTERM
b) SIGKILL
c) SIGSTOP
d) SIGINT
Ans:a

28.Which symbol represents the user's home directory?


a)~
b)@
c)#
d)/
Ans:a

29.The ___ command gives you your IP address in your


network.
a)hostname
b)hostname -I
c)host -I
d)hostname -i
Ans:b

30.The operators ">" and ">>" are known as ___.


a)Insertion operators
b)Exertion operators
c)Redirection operators
d)None of the above
Ans:c

31.What does GRUB stand for?


a)Grand Unified Bootloader
b)Grand Unification Bootloader
c)Great Unique Bootloader
d)Gum Removal Under Boot
Ans:a

32.Which answer assists you in finding help on the whois


command?
a)help whois
b)man whois
c)none of these
d)man help whois
Ans:b

33.To read one or more files and type them on standard


output, you use:
a)ls
b)cat
c)type
d)biff
Ans:b

34.Which of the following accurately describes a “ping?”


a)sends ICMP packets to target device/server to verify if
it’s online.
b)makes an audible ping each time a disk drive start
spinning
c)verifies that the routing tables comply to the current
network state
d)sends TCP packets to target device/server to verify if it’s
online.
Ans:a

35.What is the purpose of the 'grep' command in Unix?


a) To create new files
b) To delete files
c) To search for patterns in files
d) To move files from one location to another
Ans:c

36.Which command is used to create a symbolic link in


Unix?
a) ln -s
b) ln -l
c) slink
d) symlink
Ans:a

37.Which environment variable stores the user's home


directory path in Unix?
a) $usrhome
b) $homedir
c) $HOME
d) $userdir
Ans:c

38.____________ command is used to remove the


directory.
a)rdir
b)rd
c)rmdir
d)None of the above
Ans:c

39.___________is not a communication command.


a)mail
b)mesg
c)grep
d)write
Ans:c

40.Which of the following combination of keys is used to


exit from the terminal?
a)Ctrl + z
b)Ctrl + t
c)Ctrl + d
d)Ctrl + e
Ans:c

41.What is the purpose of the 'awk' command in Unix?


a) To search for files
b) To extract and manipulate text data
c) To compile C programs
d) To compress files
Ans:b

42.Which command is used to set an environment variable


in Unix?
a) setenv
b) envset
c) export
d) set
Ans:c

43.In Vim how can we move to the first line in a file?


a):$
b)k
c):0
d)Arrow Up
Ans:c

44.What does the 'cron' system in Unix handle?


a) User authentication
b) System backups
c) Job scheduling
d) Network configuration
Ans:c

45.Which is NOT a feature of UNIX?


a)user friendly
b)multiuser
c)security
d)multitasking
Ans:a

46.Which among the processes is first to run in UNIX?


a)Bash
b)shell
c)authentication
d)Browser
Ans:b

47.Which among the commands is used to create a new


process?
a)ping
b)fork
c)mkdir
d)mkfs
Ans:b

48.To report the amount of free disk space available on all


mounted file systems you use the command:
a)free
b)fs
c)du
d)df
Ans:d

49.The ___ term stands for the calendar. It displays the


current month's calendar with the current day highlighted.
a)calendar
b)calc
c)cal
d)None of the above
Ans:c

50.The netstat command give information on:


a)active sockets
b)open sockets
c)routing tables
d)All are correct
Ans:d

51.In Unix, what is the purpose of the 'tar' command?


a) To create compressed archives
b) To list the contents of a directory
c) To copy files between directories
d) To display the disk usage of files
Ans:a
52.Which command is used to view the active network
connections in Unix?
a) netstat
b) ifconfig
c) conninfo
d) netview
Ans:a

53.What is the purpose of the 'cut' command in Unix?


a) To remove files
b) To cut text from a file
c) To split files into smaller parts
d) To display file contents
Ans:b

54.Which command is used to display the last few lines of


a file in Unix?
a) head
b) tail
c) last
d) bottom
Ans:b
55.What does the 'alias' command do in Unix?
a) Creates a new user
b) Defines a new command or sets of commands
c) Lists all available commands
d) Deletes a file
Ans:b

56.Which command is used to find and replace text within


a file in Unix?
a) replace
b) findreplace
c) sed
d) switch
Ans:c

57.What is the purpose of the 'chroot' command in Unix?


a) Change user password
b) Change ownership of files
c) Change root directory for a process
d) Change file permissions
Ans:c

58.Which command is used to compress files in Unix?


a) compress
b) zip
c) gzip
d) pack
Ans:c

59.Which command is used to find files based on their


permissions in Unix?
a) find
b) locate
c) grep
d) permfind
Ans:a

60.What is the purpose of the 'iptables' command in Unix?


a) Manage network interfaces
b) Create and manage virtual machines
c) Configure firewall rules
d) Monitor system performance
Ans:c

61.Which command is used to change the priority of a


running process in Unix?
a) renice
b) prioritize
c) nice
d) priority
Ans:a

62.Which command is used to display the first few lines of


a file in Unix?
a) start
b) first
c) head
d) begin
Ans:c

63.What is the purpose of the 'uniq' command in Unix?


a) Delete duplicate files
b) Remove duplicate lines from a sorted file
c) Merge multiple files
d) Find unique files
Ans:b

64.Which command is used to change the group


ownership of a file in Unix?
a) chgrp
b) groupmod
c) chown
d) groupchown
Ans:a

65.Which command is used to list the environment


variables in Unix?
a) envlist
b) listenv
c) setenv
d) env
Ans:d

66.In Unix, what does the 'lsof' command do?


a) List all files in a directory
b) List open files and associated processes
c) List system processes
d) List system logs
Ans:b

67.Which command is used to create a new user in Unix?


a) useradd
b) adduser
c) newuser
d) createuser
Ans:a

68.What is the purpose of the 'ssh' command in Unix?


a) Change the shell for a user
b) Securely connect to remote systems
c) Share files between users
d) Shutdown the system
Ans:b

69.Which command is used to set the system hostname in


Unix?
a) hostname
b) sethostname
c) host
d) systemname
Ans:a

70.What is the purpose of the 'tee' command in Unix?


a) Display system time
b) Copy files between directories
c) Display file contents
d) Read from standard input and write to standard output
and files
Ans:d
71.Which command is used to display the last modification
time of a file in Unix?
a) lastmod
b) mtime
c) stat
d) lmod
Ans:c

72.In Unix, which command is used to change the access


time of a file?
a) touch
b) atime
c) utime
d) ctime
Ans:a

73.What does the 'umask' command in Unix do?


a) Display user accounts
b) Set the default permissions for new files
c) Display the user's home directory
d) Delete user accounts
Ans:b
74.Which command is used to terminate a non-responsive
program in Unix?
a) halt
b) kill
c) stop
d) end
Ans:b

75.What is the purpose of the 'mount' command in Unix?


a) List mounted filesystems
b) Mount a new filesystem
c) Display disk usage
d) Create a new directory
Ans:b

76.Which command is used to change the ownership of a


symbolic link in Unix?
a) chown
b) chgrp
c) chlown
d) chslink
Ans:a

77.What is the purpose of the 'basename' command in


Unix?
a) Display the full path of a file
b) Display the contents of a file
c) Display the directory name of a file
d) Display the base name of a file
Ans:d

78.Which command is used to send a signal to a process


in Unix?
a) signal
b) notify
c) kill
d) terminate
Ans:c

79.What does the 'cut' command do in Unix when used


with the '-d' option?
a) Deletes files
b) Cuts text from a file
c) Selects specific columns from a file
d) Counts the number of lines in a file
Ans:c

80.Which command is used to change the ownership of a


directory and its contents in Unix?
a) chown -r
b) chgrp -R
c) chmod -d
d) chdir -a
Ans:a

81.What is the purpose of the 'find' command in Unix?


a) Display system information
b) Search for files and directories
c) Find open network connections
d) List running processes
Ans:b

82.Which command is used to list all users currently


logged in to the system in Unix?
a) activeusers
b) who
c) users
d) loggedin
Ans:b

83.In Unix, what is the purpose of the 'chsh' command?


a) Change shell for a user
b) Change system hostname
c) Change file permissions
d) Change directory ownership
Ans:a

84.Which command is used to copy files and directories in


Unix?
a) cp
b) mv
c) copy
d) duplicate
Ans:a

85.What is the purpose of the 'echo' command in Unix


when used with the '-n' option?
a) Display the current working directory
b) Create a new file
c) Suppress the newline character
d) Display the environment variables
Ans:c

86.Which command is used to display the inode number of


a file in Unix?
a) inode
b) ls -i
c) inum
d) stat -i
Ans:b

87.What does the 'file' command do in Unix when used


with the '-i' option?
a) Display file content
b) List all available files
c) Show information about the system
d) Show MIME type of a file
Ans:d

88.Which command is used to change the group


ownership of a symbolic link in Unix?
a) chgrp
b) chown
c) chglink
d) chslink
Ans:a

89.What is the purpose of the 'uname' command in Unix?


a) Display the system time
b) Display user information
c) Display the user's name
d) Display system information
Ans:b
90.Which command is used to create a new group in
Unix?
a) newgroup
b) addgroup
c) groupadd
d) creategroup
Ans:c

91.What is the purpose of the 'umount' command in Unix?


a) Mount a new filesystem
b) Unmount a mounted filesystem
c) Display system memory usage
d) Uninstall software packages
Ans:b

92.Which command is used to change the permissions of


a file so that it's executable in Unix?
a) chmod +x
b) chmod -x
c) chmod e
d) chmod a+x
Ans:a

93.In Unix, what does the 'man' command stand for?


a) Manual
b) Manager
c) Master
d) Manage
Ans:a

94.Which command is used to display the process status


in Unix?
a) ps
b) process
c) stat
d) status
Ans:a

95.What is the purpose of the 'uptime' command in Unix?


a) Display the current date and time
b) Display the system uptime
c) Show system resource usage
d) List all running processes
Ans:b

96.Which command is used to send output to both the


screen and a file in Unix?
a) redirect
b) output
c) duplicate
d) tee
Ans:d

97.What is the purpose of the 'du' command in Unix?


a) Display system disk usage
b) List directory contents
c) Count the number of files
d) Display file attributes
Ans:a

98.Which command is used to change the owner of a file


in Unix?
a) chown
b) chuser
c) own
d) owner
Ans:a

99.In Unix, what is the purpose of the 'cpio' command?


a) Copy files between directories
b) Create and extract archives
c) List the contents of a directory
d) Compare files
Ans:b

100.Which command is used to display the contents of a


compressed file in Unix?
a) gzcat
b) zcat
c) unzip
d) untar
Ans:b

You might also like