Tag: Shell
Shell task control terms:
(1) Foreground task: Run in shell. The shell prompt does not appear before the task is completed, so other tasks cannot be run at the same time.
(2) Background task: Run in shell, but not exclusively in shell. The shell prompt can appear before the task is completed. Therefore, you can run other tasks in the same shell at the same time.
(3) pause: temporarily stop running foreground tasks
(4) resume: Resume paused tasks.
The following are some common commands:
(1) jobs: list all running tasks in Shell
(2) Ctrl + Z: Hold the foreground task. The paused task is paused, but its status will be recorded.
(3) suspend: Pause the shell, that is, CTRL + Z is run on the shell. It is mainly used to enter another shell with the su command and then want to return to the original shell.
(4) FG: Restore task. Run the task on the foreground. Put the task suspended or running in the background to the foreground. If no parameter is specified, a task is automatically selected, usually a recently suspended task or a task that has been recently executed in the background. If you want to affect a specific task, you can add a percent sign before the task number (obtained by jobs ).
(5) BG: puts paused tasks in the background for running. If no parameter is specified, it only takes effect for recently suspended tasks. If you want to affect a specific task, you can add a percent sign before the task number (obtained by jobs ).