Bash & Shell Scripting (50 Qs)•Part 3: Advanced Text Processing & Production Internals (Senior / Lead)
How does Job Control work in Bash (`&`, `nohup`, `jobs`, `fg`, `bg`, `disown`)?
senior Levelbash-shellAdvanced Text Processing
In Simple Words:
&: Runs command in the background.nohup command &: Protects background process from receivingSIGHUPwhen the terminal disconnects.jobs: Lists background jobs in the current shell.fg %1: Brings job 1 to the foreground.disown -h %1: Detaches job 1 from the shell so closing the terminal does not terminate it.