this post was submitted on 16 Dec 2025
39 points (93.3% liked)

Linux

10668 readers
346 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] stewie410@programming.dev 4 points 2 days ago (1 children)

Shouldn't you end with & disown to fully detach?

[–] Object@sh.itjust.works 2 points 2 days ago* (last edited 2 days ago) (1 children)

IIRC disown is a shell built-in command, so its use is a bit limited. Not sure if & is also a built-in, but I found disown to not work in some situations. Besides, it's shorter.

[–] stewie410@programming.dev 1 points 2 days ago

shell built-in command

After looking into it a bit more, its at least a builtin for bash but is otherwise not POSIX. I guess nohup ... & would be the POSIX compliant equivalent, though still not a builtin.

Its my understanding that & backgrounds, not necessarily detaches, a process -- if the parent process closes, I think the background tasks would still be wait()ed on, if only using &.