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
[–] Gobbel2000@programming.dev 2 points 2 days ago (2 children)

How does this even work? I get the redirection part, but how is the command executed in a detached state?

[–] Object@sh.itjust.works 3 points 2 days ago

() creates a subshell, and & runs the command in background. The $@ means everything after the first argument, so the <command> is executed like a normal command. I am not sure why this works, but it has worked more consistently than nohup, disown, and it's a lot shorter than most other solutions.

[–] MadhuGururajan@programming.dev 1 points 2 days ago* (last edited 2 days ago)

the last & is like doing "command &". d is a function that takes argument and $@ is usually the first argument