Forrest logo
back to the disown tool

disown:tldr:88b99

disown: Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit.
$ disown -h %${job_number}
try on your machine

The command "disown -h %${job_number}" is used to remove a job from the shell's jobs table, which prevents it from receiving SIGHUP (hangup) signals when the shell session ends or the terminal is closed. Here's an explanation of the command:

  • "disown" is a shell built-in command that allows detaching jobs from the shell, preventing them from being terminated by certain events like closing the terminal.
  • "-h" is an option of the "disown" command, and it specifies that the job should not receive the SIGHUP signal. SIGHUP is the signal sent to a process when the controlling terminal is closed or disconnected.
  • "%${job_number}" is a variable that represents the number or ID assigned to a job or process in the shell's job table. The percent sign (%) is used to indicate that it's referencing a job instead of a process ID.

By running "disown -h %${job_number}", you are telling the shell to remove the specified job from the job table and mark it as disowned, so it won't be affected by the shell session or terminal closure.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the disown tool