Linux Programming Mid - I, September - 2014

1.Unix has the following major components in its organization
  • Kernel
  • Shell
  • Utilities and applications
  • All of the above
Answer: D
2.What command is used to count the total number of lines, words, and characters contained in a file?
  • countw
  • wcount
  • wc
  • count p
Answer: C
3.Following command is used to display first ten lines content of a file
  • head 10 filename
  • head filename
  • head –n 10 filename
  • b & c
Answer: D
4.The _____statement accepts input to a shell script from the keyboard
  • scanf
  • printf
  • echo
  • read
Answer: D
5.In shell script $# tells
  • total number of parameters passed to the shell script
  • the first parameter passed to the shell script
  • last parameter to the shell script
  • none
Answer: A
6.The first thing that is searched when a command references a file is its
  • i-node
  • inode number
  • permission setting
  • none
Answer: B
7.The ____________function modifies the access and modification time stamps of a file
  • utime
  • time
  • date
  • sleep
Answer: A
8.A process remains a ___________ until its parent accepts its return code via the wait() system call
  • wait
  • idle
  • zombie
  • system call
Answer: C
9.The _______ system call used by a process to send a signal to itself.
  • raise
  • signal
  • sigaction
  • None
Answer: A
10.Which one is not a file handling system call
  • dup
  • dup2
  • link
  • fork
Answer: D
11.Syntax of chmod in symbolic mode is ____________________
Answer: chmod [who][+/-/=][permissions]
12.Syntax of awk____________________.
Answer: $ awk ’pattern{action}’ filename
13._________________ command is used to search files for specified words or patterns.
Answer: Grep
14.Total number of positional parameters that can be passed in shell script are _______________.
Answer: $1-$9
15.In the if statement value for success is________________.
Answer: 0
16. File descriptors for standard output is _______________.
Answer: 1
17.Everything is a _______________ in UNIX, be it a C program, a UNIX command, the printer, tape drive or the memory of your system.
Answer: File
18.A _______________ is a request for the operating system to do something on behalf of the user’s program.
Answer: System call
19.____________ is a special device file which provides a temporary buffer for two or more processes to communicate.
Answer: FIFO
20.Process is ___________________.
Answer: Program under execution