ubuntu + nohup
来源:互联网 发布:office2016for mac安装 编辑:程序博客网 时间:2024/05/16 12:00
想要让python程序在后台执行(默认python文件名为xxx): nohup python xxx.py & 此时文件输出被追加到nohup.out文件中。如果已经存在nohup.out文件,则建议先将其备份删掉,再执行命令。
想要清空nohup.out文件 cat /dev/null > nohup.out 或者 cp /dev/null nohup.out
想要复制一份nohup.out文件 cp nohup.out nohup_bak.out
想要查看此时的进程状态: ps -ef|grep python 返回的就是进程状态,第二个id就是进程ID,后面显示运行时间
想要强制关闭某个进程: kill -9 pid
想要查看nohup.out文件的内容:
head -n 100 nohup.out <查看前100行内容>
tail -n 100 nohup.out <查看后100行内容>
cat nohup.out|grep “关键字” <过滤关键字所在的行>
想要监控程序输出: tail -f nohup.out
0 0
- ubuntu + nohup
- ubuntu nohup命令
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup &
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- SlidingMenu实现透明状态栏
- 公私钥数据签名
- java Method用法
- 【Python】从爬虫开始吧——爬取妹子图整站
- 安装Android应用出错:Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
- ubuntu + nohup
- CI-搭建
- jquery $.getScript优缺点
- java反射机制中的getDeclaredField()
- 数据库内外网交换怎么做的,如果交换给你做,你怎么做
- effect C++ 尽可能使用const
- java中的位运算
- React+webpack开发环境的搭建_0
- unity 如何去除打包好的应用程序边框