Skip to main content
InterviewHubPRO
Section Overview
Q28

Question 28 of 50

Part 3: Advanced Text Processing & Production Internals (Senior / Lead)

56%
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 receiving SIGHUP when 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.