• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

disown Command Examples in Linux

by admin

The “disown” command in Linux is used to remove a running or backgrounded job from the shell’s control. This means that the job will continue to run even after the user logs out of the system or closes the terminal window.

The basic syntax of the command is:

# disown [-h] [-ar] [jobspec ...]

where:

-h: causes the job to be not listed by the jobs command.
-a: causes all jobs to be disowned.
-r: causes all running jobs to be disowned.
jobspec: specifies the job to be disowned. If no job specification is provided, the current job is used.

For example, to disown the current background job the command would be “disown %1011” where 1011 is the job number.

disown Command Examples

1. Disown the current job:

# disown

2. Disown a specific job:

# disown %job_number

3. Disown all jobs:

# disown -a

4. Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit:

# disown -h %job_number

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to extract initramfs image and edit/view it
  2. CentOS / RHEL 7 : Lock User Account After N Number of Incorrect Login Attempts
  3. make Command Examples in Linux
  4. paste Command Examples in Linux
  5. Linux OS service ‘dhcpd’
  6. telinit: command not found
  7. apt-get Command Examples in Linux
  8. battop Command Examples in Linux
  9. modprobe: command not found
  10. “docker dead but subsys locked” – error while starting docker

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright