You are on page 1of 10

UNIX SHELL PROGRAMMING(21CS482)

1) What is Unix?

a) Unix is a programming language


b) Unix is a software program
c) Unix is an operating system
d) Unix is a text editor

2) In which language UNIX is written?

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

3) Which of the following is not a feature of Unix?

a) multiuser
b) easy to use
c) multitasking
d) portability

4) Which of the following is not true about Unix?

a) UNIX was not written in ‘C’ language


b) Linux is also known as a version of UNIX
c) A user can run multiple programs at the same time; hence UNIX is called a multitasking
environment
d) Many people can use a UNIX based computer at the same time; hence UNIX is called as
a multiuser system

5) Which editor is used by the Unix system to edit files?

a) word
b) notepad++
c) vi
d) notepad

6) Which of the following is not a part of all the versions of Unix?

a) System Calls
b) Graphical user interface
c) Kernel and Shell
d) Commands and utilities

Department of CSE Page 1


UNIX SHELL PROGRAMMING(21CS482)

7) Which part of the Unix operating system interacts with the hardware?

a) Application program
b) Vi editor
c) Shell
d) Kernel

8) Which command is used for listing files in a directory?

a) list
b) ls
c) wc
d) ps

9) Which command is used by the user to change their login password in Unix?

a) cp
b) man
c) reset
d) passwd

10) Which command is used for displaying the contents of a file in Unix?

a) mkdir
b) cat
c) rm
d) cp

11) echo command is used for _________

a) displaying diagnostic messages


b) displaying date and time
c) displaying errors
d) displaying operating system details

12) 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

Department of CSE Page 2


UNIX SHELL PROGRAMMING(21CS482)

13) Shell is a command interpreter used for interacting with a UNIX system.

a) True
b) False

14) ____________ is the core of the operating system.

a) Shell
b) Kernel
c) Operating system
d) Commands

15) __________ acts as a interface between user and kernel.

a) Shell
b) Kernel
c) Operating system
d) Commands

16) ____________ is the name given to the file when it is executed as a program.

a) Process
b) Command
c) Shell
d) Kernel

17) ____________ command shows the date and time in the form used on the internet.

a) date
b) time
c) dat
d) delete

18) __________ command is used to see the calender of any specific month or a complete year.

a) calendar
b) cal
c) calend
d) calen

19) __________ command displays a list of users who are currently logged into the computer.

a) date
b) who
c) cal

Department of CSE Page 3


UNIX SHELL PROGRAMMING(21CS482)

d) ls

20) ______________ command displays and changes settings.

a) tty
b) stty
c) ty
d) sy

21) __________ command tells the filename of the terminal user is using.

a) tty
b) stty
c) ty
d) sy

22) _________ command is used for clearing the screen.

a) tput
b) ls
c) who
d) cat

23) Which command is used to display and create files.

a) cat
b) vi
c) ed
d) ls

24) The ls –l command tells

a) Who owner of the file is


b) The name of the group owner of the file
c) How large the file is and when the file was last modified
d) All of the above

25) Which of the following commands is used to display the filenames in multiple columns.

a) ls
b) ls –l
c) ls –x
d) lc

Department of CSE Page 4


UNIX SHELL PROGRAMMING(21CS482)

26) The Unix shell is both _______ and _______ language.

a) scripting, interpreter
b) high level, low level
c) interactive, responsive
d) interpreter, executing

27) Which of the following is the first UNIX editor?

a) vi
b) emacs
c) ex
d) ed

28) Which process is immediately set up by the kernel when we log on to a Unix system?

a) System
b) bash
c) shell
d) parent

29) Which of the following cannot be performed by cat command?

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

30) What is the windowing system of UNIX known as?

a) X Window system
b) LINUX
c) Red Hat
d) DOS

31) Two UNIX systems may or may not use the same set of system calls.

a) True
b) False

32) Shell is a command interpreter used for interacting with a UNIX system.

a) True
b) False

Department of CSE Page 5


UNIX SHELL PROGRAMMING(21CS482)

33) Apart from displaying file contents, cat command is also used for _____ files.

a) displaying
b) deleting
c) copying
d) creating

34) Multiple arguments as filenames can be specified in cat command.

a) True
b) False

35) Which symbol is used with cat command for creating files?

a) >
b) <
c) *
d) /

36) If we create a file using cat command with the same filename which already exists in the
current directory then,

a) existing file is deleted


b) new file will be created separately
c) existing file will be overwritten
d) an error will be produced

37) Which symbol is used to append an existing file?

a) >
b) <
c) >>
d) $

38) Which option is used with cat command for displaying non-printable characters?

a) -v
b) -n
c) -x
d) -a

Department of CSE Page 6


UNIX SHELL PROGRAMMING(21CS482)

39) Which option is used with the cat command for displaying file with line numbers?

a) -n
b) -v
c) -a
d) -x

40) Which one of the following commands is incorrect?

a) cat file01
b) cat > file01
c) cat >> file1
d) cat -a file01

41) Which command is used for extracting the details of the operating system?

a) cd
b) echo
c) uname
d) wc

42) What are escape sequences?

a) special characters beginning with a \ (backslash)


b) special commands
c) special utilities
d) a sequence of characters

43) Which of the following is not a valid escape sequence in UNIX?

a) \n
b) \t
c) \v
d) \d

44) Which command is used as an alternative to echo command?

a) ls
b) printf
c) wc
d) ps

Department of CSE Page 7


UNIX SHELL PROGRAMMING(21CS482)

45) -h option is used with who command for what purpose?

a) display output with header information


b) display output with a more detailed version
c) display output with trailer information
d) display output in columnar form

46) Which option is used with ls command for long listing of files with seven attributes?

a) -a
b) -l
c) -x
d) -i

47) Which option is used with ls to display attributes of the directory ?

a) -a
b) -ld
c) -d
d) -o

48) -a option is used with ls command for what purpose?

a) for showing hidden files


b) for showing executables
c) for showing directories
d) for multi columnar output

49) Which option is used with ls command to produce multi columnar output?

a) -x
b) -F
c) -a
d) -v

50) What is the collating sequence of ls command for listing files?

a) Numerals > Uppercase > Lowercase


b) Numerals > Lowercase > Uppercase
c) Lowercase > Uppercase > Numerals
d) Uppercase > Numerals > Lowercase

Department of CSE Page 8


UNIX SHELL PROGRAMMING(21CS482)

51) How can we identify executables and directories from the output of ls command?

a) using -F option
b) using -x option
c) using -a option
d) using -i option

52) UNIX was developed by

a) Ken Thompson and Dennis Ritchie


b) Paul Walker and John Cambell
c) Bjarne stroustrup and Dennis Ritchie
d) Bjarne stroustrup and Ken Thompson

53) UNIX was developed at _____________

a) Microsoft Corporation, USA


b) AT & T bell Laboratories, USA
c) IBM,USA
d) Borland International, USA

54) Programs access the kernel through a set of functions called

a) Kernel
b) System Calls
c) Process
d) Commands

55) Options are also arguments but begins with -.

a) True
b) False

57) 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

58) Which command is used for displaying date in the format dd/mm/yyyy ?

a) date +%m
b) date +%h
c) date +”%d%m%y”

Department of CSE Page 9


UNIX SHELL PROGRAMMING(21CS482)

d) date +”%h %m”

59) ls –R outputs all files and subdirectories in a recursive manner.

a) True
b) False

60) The output of dir* is _____________

a) All files in the current directory


b) All files in the directory having a filename starting with dir
c) No filename is displayed
d) Erroneous

61) Which option is used along with uname command for finding the version of the operating
system.

a) -r
b) -a
c) -b
d) -n

62) Which option is used along with uname command for displaying host name.

a) -r
b) -a
c) -b
d) -n

Department of CSE Page 10

You might also like