IshallbeThatIshallbe:~ iamthat$ ps -ef |grep ping
502 450 1 0 9:30PM ?? 0:00.05 ping www.baidu.com
502 492 475 0 9:32PM ttys000 0:00.00 grep ping
IshallbeThatIshallbe:~ iamthat$ kill -9 502
-bash: kill: (502) - No such process
IshallbeThatIshallbe:~ iamthat$ kill -9 450
IshallbeThatIshallbe:~ iamthat$ ps -ef |grep ping
502 495 475 0 9:33PM ttys000 0:00.00 grep ping 首先我这里 kill ping 百度的进程 重新演示
创建程序:

IshallbeThatIshallbe:~ iamthat$ nohup ping www.baidu.com >> ping.txt &
[1] 507 ---注意这为进程号
IshallbeThatIshallbe:~ iamthat$
可以看到该程序不断有输出

IshallbeThatIshallbe:~ iamthat$ tail -f ping.txt
64 bytes from 180.97.33.108: icmp_seq=19 ttl=54 time=46.477 ms
64 bytes from 180.97.33.108: icmp_seq=20 ttl=54 time=45.426 ms
64 bytes from 180.97.33.108: icmp_seq=21 ttl=54 time=46.482 ms
64 bytes from 180.97.33.108: icmp_seq=22 ttl=54 time=45.679 ms
64 bytes from 180.97.33.108: icmp_seq=23 ttl=54 time=46.772 ms
64 bytes from 180.97.33.108: icmp_seq=24 ttl=54 time=47.559 ms
64 bytes from 180.97.33.108: icmp_seq=25 ttl=54 time=45.568 ms
64 bytes from 180.97.33.108: icmp_seq=26 ttl=54 time=44.652 ms
64 bytes from 180.97.33.108: icmp_seq=27 ttl=54 time=44.747 ms
64 bytes from 180.97.33.108: icmp_seq=28 ttl=54 time=45.868 ms
64 bytes from 180.97.33.108: icmp_seq=29 ttl=54 time=47.068 ms
64 bytes from 180.97.33.108: icmp_seq=30 ttl=54 time=46.171 ms
64 bytes from 180.97.33.108: icmp_seq=31 ttl=54 time=47.026 ms
64 bytes from 180.97.33.108: icmp_seq=32 ttl=54 time=45.162 ms
64

关闭终端,重新打开一个终端

Last login: Wed Apr  1 21:37:38 on ttys000
IshallbeThatIshallbe:~ iamthat$ tail -f ping.txt
64 bytes from 180.97.33.108: icmp_seq=76 ttl=54 time=48.586 ms
64 bytes from 180.97.33.108: icmp_seq=77 ttl=54 time=46.160 ms
64 bytes from 180.97.33.108: icmp_seq=78 ttl=54 time=48.099 ms
64 bytes from 180.97.33.108: icmp_seq=79 ttl=54 time=44.345 ms
64 bytes from 180.97.33.108: icmp_seq=80 ttl=54 time=47.058 ms
64 bytes from 180.97.33.108: icmp_seq=81 ttl=54 time=44.917 ms
64 bytes from 180.97.33.108: icmp_seq=82 ttl=54 time=44.886 ms
64 bytes from 180.97.33.108: icmp_seq=83 ttl=54 time=47.997 ms
64 bytes from 180.97.33.108: icmp_seq=84 ttl=54 time=45.928 ms
64 bytes from 180.97.33.108: icmp_seq=85 ttl=54 time=46.988 ms
64 bytes from 180.97.33.108: icmp_seq=86 ttl=54 time=44.337 ms
64 bytes from 180.97.33.108: icmp_seq=87 ttl=54 time=48.580 ms

程序依然在输出在运行。

可以看到那个507的进程一直在跑

IshallbeThatIshallbe:~ iamthat$ ps -ef |grep ping
502 507 1 0 9:36PM ?? 0:00.05 ping www.baidu.com
502 528 520 0 9:38PM ttys000 0:00.00 grep ping
IshallbeThatIshallbe:~ iamthat$

最新文章

  1. maven 下载 源码和javadoc 命令
  2. [Tools] 使用work2013发布博客
  3. 关于jsonp跨域过程中 cookie中的值一直为null的原因
  4. java连接mongodb的一个奇葩问题及奇葩解决方式
  5. PHP变量作用域以及地址引用问题
  6. CSS(04) 定位
  7. hdu 4696 Answers
  8. iOS之应用内跳转系统设置相关界面
  9. Qt编程之信号与槽-------unresolved external symbol "public: virtual struct QMetaObject const * __thiscall XX::metaObject(void)const
  10. 启动网页时候自己主动载入servlet假设不使用strus最经常使用的两种方式
  11. mov sreg, r/m16 在16位和32位编程中的区别
  12. typeof判断类型(数组类型得用instanceof)
  13. 如何使用DockerHub官方的mysql镜像
  14. PHP小技巧
  15. pyc
  16. 开机出现loading (hd0)/ntldr。。。
  17. squid 透明代理配置
  18. JDK命令行工具
  19. NoSQL&Redis
  20. learning at commad AT+CPSI

热门文章

  1. ADO.NET笔记——调用存储过程
  2. ajax对一些没有接口的数据进行分析和添加方法
  3. openerp学习笔记 自定义小数精度(小数位数)
  4. VS2010打开VS2012解决方法
  5. Android手机做无线中继路由器
  6. IOS开发之──应用之间调用(2)
  7. 关于php框架
  8. 序列化form表单内容为json对象
  9. Java 8 VM GC Tunning Guild Charter 9-b
  10. aspnet_regiis.exe 的用法