Unix Questions and Answers – Process Management – 2

This set of Unix Problems focuses on “Process Management – 2”.

1. We can list the jobs queued using at command by using ____ option.
a) -p
b) -v
c) -l
d) -r
View Answer

Answer: c
Explanation: Jobs scheduled using at command are sent to a queue for later execution. To list the jobs in this queue we can use the -l option with at command. This command will list each of the scheduled jobs in the queue in this format.

1        Thur  Jan 17  12:08:00 2018-01-20

2. To remove a job from the queue, which option is used with at command?
a) -r
b) -l
c) -e
d) -t
View Answer

Answer: a
Explanation: Jobs can be listed using -l option with at command and can be removed using -r option. All we have to do is to provide the job number (of the job which we want to remove from the queue) as an argument to at command along with -r option. For example,

advertisement
advertisement
$ at  -r  1        // removes job 1 from the queue.

3. We cannot find out the name of the program scheduled using at command.
a) True
b) False
View Answer

Answer: a
Explanation: Unfortunately, the major drawback in at command is that we cannot find out the name of the program scheduled to be executed. This may create a problem when we are unable to recall whether a specific job has actually been scheduled for later execution.

4. Which command permits to schedule jobs for later execution, as soon as the system load permits?
a) at
b) %
c) batch
d) cron
View Answer

Answer: c
Explanation: The batch command also allows us to schedule jobs for later execution but unlike at command, it executes the jobs as soon as the system load permits. For example,

$ batch <  emp.sh

Commands will be executed using usr/bin/bash
Job 1016171818.a at Sun Jan 15 16:07:00 2018
This command doesn’t take any arguments but uses an internal algorithm to determine the execution time.

advertisement

5. Jobs scheduled using batch command goes to a special at queue.
a) True
b) False
View Answer

Answer: a
Explanation: The batch command also allows us to schedule jobs for later execution but unlike at command, it executes the jobs as soon as the system load permits. Any job scheduled using batch goes to a special at queue.
advertisement

6. Jobs scheduled using batch command can be removed using ___ option.
a) -a
b) -d
c) -f
d) -r
View Answer

Answer: d
Explanation: Any job scheduled using batch goes to a special at queue. To remove a job from this queue we can use the -r option with at command. For example,

$ at  -r  1        // removes job 1 from the queue.

7. 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
View Answer

Answer: d
Explanation: Daemons are processes which run automatically without requiring any user interaction. These are designed to help the user by performing tasks which are commonly done. For example, checking for an e-mail.

8. What is cron?
a) a simple process
b) an orphan process
c) a daemon
d) a zombie process
View Answer

Answer: c
Explanation: cron is a daemon which runs on UNIX systems. It executes programs at regular intervals. It lets us to schedule jobs so that they can be scheduled repeatedly. It executes cron jobs created by the crontab. For example, a cron job can be scheduled for processing logs every evening.

9. The cron tab is a table having a list of commands that are scheduled to be run at regular intervals.
a) True
b) False
View Answer

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.

10. Which of the following command will remove the current crontab?
a) crontab -p
b) crontab -l
c) crontab -e
d) crontab -r
View Answer

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.

11. To find out how efficiently a program a used the system resources, which command is used?
a) sys
b) time
c) crontab
d) daemon
View Answer

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. For example,

$ time sort -o  emp.txt  invoi.txt
real    0m19.811s    // time elapsed from the invocation of command until its termination
user    0m1.851s    // time spent in executing itself
sys    0m9.761s    // time spent by the kernel in doing work on behalf of the user process

Sanfoundry Global Education & Learning Series – Unix.

To practice all areas of Unix Problems, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.