Unix Module 5 MCQ
Unix Module 5 MCQ
Unix Module 5 MCQ
A. pidentity
B. processidentity
C. pid
D. proid
2. When you start a process (run a command), how many ways you can run it?
A. 2
B. 3
C. 4
D. 5
A. Foreground
B. Background
C. Both A and B
D. None of the above
A. waiting
B. executing
C. terminated
D. halted
5. Which data structure is used to store information about a process?
A. pwd
B. fork
C. cd
D. Both A and C
A. bg
B. gd
C. fg
D. kill
8. What is cron?
A. a simple process
B. an orphan process
C. a daemon
D. a zombie process
9. What is a daemon?
12. Which option is used by ps command to get a detailed listing of process attributes?
a) -u
b) -f
c) -l
d) –x
13. Which option is used by the system administrator for displaying processes of a user?
a) -f
b) -u
c) -a
d) –e
14. The -a option when used with ps command lists processes of all users but doesn’t
display the system processes.
a) True
b) False
17. Which of the following system call is used for creating a new process?
a) read
b) fork
c) wait
d) new
18. When fork() is invoked, the child process created gets a new PID.
a) True
b) False
20. The cron tab is a table having a list of commands that are scheduled to be run at
regular intervals.
a) True
b) False
21. Which of the following command will remove the current crontab?
a) crontab -p
b) crontab -l
c) crontab -e
d) crontab –r
22. To find out how efficiently a program a used the system resources, which command
is used?
a) sys
b) time
c) crontab
d) daemon
A. /etc/crontab
B. /var/spool
C. /var/spool/cron
D. ~/.cron
Answers
1. Ans : C
2. Ans : A
Explanation: When you start a process (run a command), there are two ways you
can run it : Foreground Processes and Background Processes.
3. Ans : A
Explanation: By default, every process that you start runs in the foreground.
4. Ans : B
Explanation: A process control block is a data structure which is used for storing
information about a process.
6. Ans : D
Explanation: When we run a command, a process representing the command is
started by the shell process but all commands don't set up processes. Built-in
commands of the shell like pwd, cd etc do not create processes.
7. Ans : C
Explanation: We can use the fg command to bring any of the background jobs to
the foreground.
8. Ans : C
9. Ans : D
10. Answer: c
Explanation: ps command is used to show some attributes of a process. This
command reads through the kernel’s data structures and process tables to fetch the
characteristics of a process. By default, ps command displays the processes owned
by the user running the command.
11. Answer: d
Explanation: ps command displays the processes owned by the user running the
command. If we execute the command immediately after logging in,
12. Answer: b
Explanation: ps is a highly variant command; its actual output varies across
different flavours. To get a detailed listing of process attributes along with PPID
and owner (UID), we have to use the -f option with ps command.
13. Answer: b
Explanation: The system administrator needs to use the -u (user) option to know
the activities of a user
14. Answer: a
Explanation: The -a (all) option lists processes of all users but doesn’t display the
system processes
15. Answer: d
Explanation: Apart from processes a user generates, a number of system processes
keep running all the time. Most of them are not associated with any terminal. To
list all process on our machine, we can use either -A or -e option with ps
command. But beware, this list could be very long on a busy system.
16. Answer: d
Explanation: There are three distinct phases of a process which uses three different
system calls or functions. A process can be in its initial state when it is created,
after that, the process is in execution state when the instructions of a process are
being executed. The third phase of a process is waiting for state when the process
is waiting for some action to be taken.
17. Answer: b
Explanation: A process in UNIX is created using fork() system call. It creates an
exact copy of the process that invokes it. Now there will be two processes, one
parent process and one child process. The process which invokes the fork system
call is called parent process and the new process created is called child process.
18. Answer: a
Explanation: The process created using fork is practically identical to that of
calling process except for a few parameters like PID. When a process is forked in
this manner, the child process gets a new PID.
19. Answer: c
Explanation: Forking creates a new process but it is not enough to run a new
program. To do so, the forked child needs to overwrite its own images with the
code and data of the new program. This mechanism is called exec and the child
process is said to exec a new program.
20. Answer: a
Explanation: The cron-tab or cron table is a list of commands that are scheduled to
be run at regular intervals. The crontab command opens the crontab for
scheduling, editing, removing, modify scheduled tasks
21. Answer: d
Explanation: We can see the contents of our crontab file using crontab -l command
and can remove them with crontab -r. We can also enter cron commands using
crontab -e command.
22. Answer: b
Explanation: When there are multiple versions of a program and we want to find
out how efficiently they’ve used the system resources we can use the time
command. The time command accepts the entire command line to be timed as its
argument. It executes the command and also displays the time usage on the
terminal.
23. Answer – – C
Description – User crontab files are stored in /var/spool/cron.