Linux / Unix: disown Command Examples

The “disown” command in Linux and Unix is used to remove a job from the control of the terminal and shell. When a job is disowned, it will continue to run in the background even if the terminal is closed, or the user logs out.

Here are some examples of how to use the “disown” command:

  1. To disown the current background job, use the following command:
disown
  1. To disown a specific background job, you can use its job number with the “disown” command:
disown %<jobnumber>

Replace “<jobnumber>” with the number of the job that you want to disown. You can find the job numbers for all the background jobs by using the “jobs” command.

  1. To disown all background jobs, you can use the following command:
disown -a

Once a job is disowned, it will no longer be controlled by the terminal or shell. However, it is still possible to kill the job if necessary by using its process ID or job number.

Leave a Comment