Pause the process by pressing CTRL + Z, then use the bg command to resume it in the background. For example:
sleep 60 ^Z #Suspend character shown after hitting CTRL+Z [1]+ Stopped sleep 60 #Message showing stopped process info bg #Resume current job (last job stopped)
Learn more about job management and using bg in the bash manual page:
CONTROL OF WORK
Entering a pause character (usually ^ Z, Control-Z) during the execution of a process causes the process to stop and returns control to bash. [...] The user can then manipulate the state of this job using the bg command to continue in the background, [...]. ^ Z takes effect immediately, and has an additional side effect, causing the pending output and typeahead to be discarded.
bg [jobspec ...]
Resume each paused job in the background, as if it were running with &. If jobspec is missing, the shell concept of the current job is used.
EDIT
To start a process where you can even kill a terminal, and it still continues to work
nohup [command] [-args] > [filename] 2>&1 &
eg
nohup /home/edheal/myprog -arg1 -arg2 > /home/edheal/output.txt 2>&1 &
To just ignore the output (not very smart), change the file name to /dev/null
To get an error message for another file, change &1 to the file name.
Ed Heal Dec 03 2018-12-12T00: 00Z
source share