0% found this document useful (0 votes)
51 views

Unit 5 Objective Questions

This document discusses processes and process management in UNIX systems. Some key points include: - A process is an executing program and is identified by its unique PID. It goes through various states like born, running, terminated. - The kernel maintains process information and attributes in a process control block (PCB). - Common process management commands are ps and kill which display and terminate processes respectively. - Signals are used to communicate with processes and can be handled using the trap command. - Background processes, scheduling, and inter-process communication are also covered.

Uploaded by

sumitashetty19
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)
51 views

Unit 5 Objective Questions

This document discusses processes and process management in UNIX systems. Some key points include: - A process is an executing program and is identified by its unique PID. It goes through various states like born, running, terminated. - The kernel maintains process information and attributes in a process control block (PCB). - Common process management commands are ps and kill which display and terminate processes respectively. - Signals are used to communicate with processes and can be handled using the trap command. - Background processes, scheduling, and inter-process communication are also covered.

Uploaded by

sumitashetty19
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/ 9

UNIX SHELL PROGRAMMING (21CS482)

1) A process is an instance of _______ program.

a) waiting
b) executing
c) terminated
d) halted

2) A process is said to be ____ when it starts its execution.

a) born
b) die
c) waiting
d) terminated

3) When the process has completed its execution it is called ______


a) born
b) terminated
c) waiting
d) exit

4) Some attributes of every process are maintained by the kernel in memory in a separate
structure called the ______

a) pcb
b) task control block
c) process table
d) task table

5) Each process is identified by a unique integer called ______

a) PID
b) PPID
c) TID
d) PTID

6) Every process has a parent process.

a) True
b) False

7) The parent id of a child is called ______

Department of CSE Page 1


UNIX SHELL PROGRAMMING (21CS482)

a) PID
b) PPID
c) TID
d) PTID

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

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

9) To know the PID of your current shell, which command will be used?

a) echo $$
b) echo $
c) $SHELL
d) $PATH

10) What is the PID of the first process that is set up when the system is booted?

a) 1
b) 0
c) any
d) 2

11) Which command shows some attributes of a process?

a) pid
b) $$
c) ps
d) HOME

12) Which of the following attribute is not shown by ps command?

a) PID
b) PPID
c) tty
d) size

13) Which option is used by ps command to get a detailed listing of process attributes?

a) -u
b) -f

Department of CSE Page 2


UNIX SHELL PROGRAMMING (21CS482)

c) -l
d) -x

14) Which option is used by the system administrator for displaying processes of a user?

a) -f
b) -u
c) -a
d) -e

15) Which option is used with ps command to list system processes?

a) -A
b) -a
c) -e
d) –A and -e

16) There are ___ distinct phases of a process.

a) 2
b) 5
c) 4
d) 3

17) A system call is a programmatic way in which the program requests for the service from the
kernel of an operating system.

a) True
b) False

18) Which of the following system call is used for creating a new process?

a) read
b) fork
c) wait
d) new

19) What is the value returned by fork system call, when the creation of child process is
unsuccessful?

a) positive integer
b) negative integer
c) zero
d) fractional value

Department of CSE Page 3


UNIX SHELL PROGRAMMING (21CS482)

20) Which system call is used to run a new program?

a) fork
b) wait
c) exec
d) exit

21) Which system call is used by the parent process to wait for the child process to complete?

a) wait
b) exec
c) fork
d) exit

22) We can schedule a job to run at a specified time of day using _______ command.

a) batch
b) at
c) cron
d) jobs

23) Which of the following keyword is not supported by at command?

a) now
b) noon
c) tomorrow
d) evening

24) To remove a job from the queue, which option is used with at command?

a) -r
b) -l
c) -e
d) -t

25) We can list the jobs queued using at command by using ____ option.

a) -p
b) -v
c) -l
d) -r

26) We cannot find out the name of the program scheduled using at command.

Department of CSE Page 4


UNIX SHELL PROGRAMMING (21CS482)

a) True
b) False

27) Which command permits to schedule jobs for later execution, as soon as the system load
permits?

a) at
b) %
c) batch
d) cron

28) Jobs scheduled using batch command goes to a special at queue.

a) True
b) False

29) Jobs scheduled using batch command can be removed using ___ option.

a) -a
b) -d
c) -f
d) -r

30) What is cron?

a) a simple process
b) an orphan process
c) a daemon
d) a zombie process

31) The cron tab is a table having a list of commands that are scheduled to be run at regular
intervals.

a) True
b) False

32) Which of the following command will remove the current crontab?

a) crontab -p
b) crontab -l
c) crontab -e
d) crontab -r

33) _______ option of ps command lists processes of all users but doesn’t display the system
processes.

Department of CSE Page 5


UNIX SHELL PROGRAMMING (21CS482)

a) -f
b) -u
c) -a
d) -e

34)Programs and process are synonymous.

a)True

b)False

35)Which data structure is used to store information about a process?

a)Process control block(pcb)

b)Array

c)Queue

d)Program Control Block

36) What will the output of the following command?

$ ps -t dev/console
a) processes running on terminal named console
b) undefined output
c) erroneous
d) processes running on the current terminal

37) When fork() is invoked, the child process created gets a new PID.

a) True

b) False

38) Which command is used for premature termination of a process?

a) signal

b) nice

c) kill

d) nohup

39) Which one of the following command is used for killing the last background job?

Department of CSE Page 6


UNIX SHELL PROGRAMMING (21CS482)

a) kill $
b) kill $$
c) kill $!
d) kill !

40) We can use the _____ symbol with at command to redirect our output to a specified file.

a) >
b) <
c) >>
d) %

41) Which one of the following forms used with at command is invalid?

a) at noon
b) at now +2 years
c) at 3:07 + 1 day
d) at morning

42) What is a daemon?

a) process whose parent has died

b) process who has completed its execution but still has an entry in the process table

c) process which is running infinitely

d) process which runs automatically without any user interaction

43) Where are user crontab files stored?

a) /etc/crontab
b) /var/spool
c) /var/spool/cron
d) ~/.cron

44) ________ command is used to place the file in the directory containing crontab files for cron
to read file again.

a) crontab

b) cron

c) at

d) batch

Department of CSE Page 7


UNIX SHELL PROGRAMMING (21CS482)

45) Each line of crontab file consists of ________ fields.

a) 5

b) 6

c) 4

d) 7

46) Which signal is generated when we press Cntrl+C ?

a) SIGINT

b) SIGTERM

c) SIGKILL

d ) SIGSEGV

47) Which signal is generated when we press Cntrl+Z ?

a) SIGSTOP

b) SIGTERM

c) SIGKILL

d ) SIGSEGV

48) Which signal is sent when the child process terminates ?

a) SIGSTOP

b) SIGTERM

c) SIGKILL

d ) SIGCHLD

49) Signals are handled using __________ system call.

a) kill

b) signal

c) Both a and b

d) None of the above

Department of CSE Page 8


UNIX SHELL PROGRAMMING (21CS482)

50) The usual effect of abnormal termination of a program is ___________.

a) Core dump file generation

b) System crash

c) Program switch

d) Signal destruction

51) Signals are identified by _____________

a) Signal identifiers

b) Signal handlers

c) Signal actions

d) None of the mentioned

52) The three ways in which a process responds to a signal are _________

a) Ignoring the signal

b) Handling the signal

c) Performing the default action

d) All of the mentioned

53) Choose the correct form of trap command.

a) trap ‘command_list’ signal_list

b) trap ‘signal_list’ command_list

c) Both a and b

d) None of the above

54) What is the PID of the first process that is set up when the system is booted?

a) 0

b) 1

c) 2

d) 3

Department of CSE Page 9

You might also like