我怎么可以把后台当前运行Linux进程? [英] How can I put the current running linux process in background?

查看:151
本文介绍了我怎么可以把后台当前运行Linux进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个上传用git文件在Linux shell远程服务器的指令,它会需要几个小时才能完成。

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?

推荐答案

CTRL + Z然后使用命令 BG 把过程在后台。

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

修改

要启动一个过程,你甚至可以杀死终端,它仍然进行运行

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

nohup <command> <args> ><filename> 2>&1 &

例如

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

要忽略输出(不是很明智)更改文件名以的/ dev / null的

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

要获取设置为不同的文件更改错误信息的&放大器; 1 来的文件名

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

这篇关于我怎么可以把后台当前运行Linux进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆