- IT 리더가 지목한 AI 가치 실현의 최대 걸림돌은 ‘비용 관리’
- Los CIO consideran que la gestión de costes puede acabar con el valor de la IA
- 칼럼 | AI 에이전트, 지금까지의 어떤 기술과도 다르다
- The $23 Echo Dot deal is a great deal to upgrade your smart home this Black Friday
- Amazon's Echo Spot smart alarm clock is almost half off this Black Friday
Backgrounding and foregrounding processes in the Linux terminal
Running commands in the Linux terminal is likely something you do nearly every day, but moving a running process into the “background” and later moving it back into the “foreground” is something different altogether. When a process is running in the foreground (the usual state of running commands), it could be said to “own your terminal”. In other words, you will likely sit and wait for it to finish before you even try to run another command. If a process is likely to take a long time to complete, on the other hand, you do have an option other than waiting patiently for it to get done. You can move it into the background – freeing up your terminal window to run other commands.
Moving a process to the background
To move a process into the background, you would type ^z (hold the Ctrl key and press “z”) to suspend it, and then type bg to move it into the background. The process will keep running, but you’ll get your prompt back and be able to work on something else while it’s still running to completion in the background. Note that a backgrounded process will keep running until it’s done or until you log off. Here’s an example:
$ sleep 1000 ^Z [1]+ Stopped sleep 1000 $ bg [1]+ sleep 1000 &
Checking on backgrounded processes with the jobs command
To list backgrounded processes, use the jobs command like this: