How to resume then send a program back to the background

I know I can run something in the background by adding & to it, such as tail -f log.log

I can then resume or send the job to the foregrond with fg

However, once I do this, how do I send it to the background again? Ctl-z stops the task, and Ctl-c kills it.

When I type bg nothing happens.

Answer

Once you have use Ctrl+z to stop the process, you can send it to the background with the bg command. You probably want to take a look at the jobs command too.

help bg
bg: bg [job_spec …]
Move jobs to the background.

Place the jobs identified by each JOB_SPEC in the background, as if they
had been started with `&’. If JOB_SPEC is not present, the shell’s notion
of the current job is used.

Exit Status:
Returns success unless job control is not enabled or an error occurs.

Attribution
Source : Link , Question Author : Startec , Answer Author : user9517

Leave a Comment