What is the purpose of the nohup command in UNIX?

What is the purpose of the nohup command in UNIX?

a) To run a command that will continue running after logout
b) To display system processes
c) To display system uptime
d) To log off the system

Answer:

a) To run a command that will continue running after logout

Explanation:

The nohup command in UNIX stands for “no hang up,” and it allows a process to continue running in the background even after the user logs out. This is useful for long-running processes, such as backups or downloads, that you want to keep active after you disconnect.

For example, running nohup command & will start the command in the background and prevent it from being terminated when you log out of the system. The output is typically saved to a nohup.out file unless redirected to another file.

Mastering the nohup command is essential for managing long-running tasks in UNIX. It ensures that critical processes continue running even if your session is interrupted, providing reliability for unattended tasks.

Reference:

Top 50 Unix MCQ Questions & Answers

Scroll to Top