What are background and foreground processes?

Beginner

Answer

Foreground processes: Run in the terminal and accept input
Background processes: Run independently without blocking terminal

# Run command in background
command &               # Start in background
nohup command &         # Continue after logout
# Job control
jobs                    # List current jobs
fg %1                   # Bring job 1 to foreground
bg %1                   # Send job 1 to background
Ctrl+Z                  # Suspend current process
Ctrl+C                  # Terminate current process
# Detach from terminal
nohup long_command > output.log 2>&1 &
disown %1               # Remove job from shell