How can I put the current running linux process in

2019-01-29 22:49发布

I have a command that uploads files using git to a remote server from the Linux shell and it will take many hours to finish.

How can I put that running program in background? So that I can still work on shell and that process also gets completed?

1条回答
【Aperson】
2楼-- · 2019-01-29 23:14

CTRL+Z then use the command bg to put the process in the background.

EDIT

To start a process where you can even kill the terminal and it still carries on running

nohup [command] [-args] > [filename] 2>&1 &

e.g.

nohup /home/edheal/myprog -arg1 -arg2 > /home/edheal/output.txt 2>&1 &

To just ignore the output (not very wise) change the filename to /dev/null

To get the error message set to a different file change the &1 to a filename.

查看更多
登录 后发表回答