日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

9.10 nohup:用户退出系统进程继续工作

發布時間:2024/9/3 windows 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 9.10 nohup:用户退出系统进程继续工作 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

nohup命令

可以將程序以忽略掛起信號的方式運行起來,被運行程序的輸出信息將不會顯示到終端。 無論是否將nohup命令的輸出重定向到終端,輸出都將寫入到當前目錄的nohup.out文件中。如果當前目錄的nohup.out文件不可寫,則輸出重定向到$HOME/nohup.out文件中。

讓執行的命令在當前會話終止后繼續保持運行

正常情況下,如果用戶退出登錄或會話終止,則用戶正在執行并可持續一段時間的命令(非守護進程)將自動終止。使用nohup命令可以實現在用戶退出或當前會話終止后繼續保持運行,具體的例子如下: [root@cs6 ~]# nohup ping g.cn nohup: 忽略輸入并把輸出追加到"nohup.out" #<==當前終端已經hang住,此時強制關閉當前終端(例如關閉該標簽或者Ss日客戶端工具),這個ping命令依然會在后臺運行。 # 但是Ctrl + C 會退出命令執行[root@cs6 ~]# ps -ef|grep ping root 1818 1 0 19:19 ? 00:00:00 ping g.cn root 1820 1797 0 19:19 pts/1 00:00:00 grep ping[root@cs6 ~]# tail -f nohup.out 64 bytes from 203.208.40.79: icmp_seq=97 ttl=128 time=42.2 ms 64 bytes from 203.208.40.79: icmp_seq=98 ttl=128 time=42.7 ms 64 bytes from 203.208.40.79: icmp_seq=99 ttl=128 time=42.7 ms 64 bytes from 203.208.40.79: icmp_seq=100 ttl=128 time=42.7 ms 64 bytes from 203.208.40.79: icmp_seq=101 ttl=128 time=42.6 ms 64 bytes from 203.208.40.79: icmp_seq=102 ttl=128 time=42.4 ms 64 bytes from 203.208.40.79: icmp_seq=103 ttl=128 time=43.0 ms 64 bytes from 203.208.40.79: icmp_seq=104 ttl=128 time=50.7 ms 64 bytes from 203.208.40.79: icmp_seq=105 ttl=128 time=42.9 ms 64 bytes from 203.208.40.79: icmp_seq=106 ttl=128 time=43.0 ms 在工作中我們一般會配合&符運行nohup命令,讓程序直接在后臺運行: [root@cs6 ~]# nohup ping g.cn & [1] 1855 [root@cs6 ~]# nohup: 忽略輸入并把輸出追加到"nohup.out"[root@cs6 ~]# tail -f nohup.out 64 bytes from 203.208.40.95: icmp_seq=8 ttl=128 time=42.1 ms 64 bytes from 203.208.40.95: icmp_seq=9 ttl=128 time=43.3 ms 64 bytes from 203.208.40.95: icmp_seq=10 ttl=128 time=44.1 ms 64 bytes from 203.208.40.95: icmp_seq=11 ttl=128 time=42.5 ms 64 bytes from 203.208.40.95: icmp_seq=12 ttl=128 time=42.9 ms 64 bytes from 203.208.40.95: icmp_seq=13 ttl=128 time=42.6 ms 64 bytes from 203.208.40.95: icmp_seq=14 ttl=128 time=42.8 ms 64 bytes from 203.208.40.95: icmp_seq=15 ttl=128 time=42.8 ms 64 bytes from 203.208.40.95: icmp_seq=16 ttl=128 time=134 ms 64 bytes from 203.208.40.95: icmp_seq=17 ttl=128 time=42.8 ms 64 bytes from 203.208.40.95: icmp_seq=18 ttl=128 time=42.2 ms 64 bytes from 203.208.40.95: icmp_seq=19 ttl=128 time=43.2 ms 64 bytes from 203.208.40.95: icmp_seq=20 ttl=128 time=43.7 ms 64 bytes from 203.208.40.95: icmp_seq=21 ttl=128 time=42.0 ms
類似功能的命令還有screen和直接使用&符。

總結

以上是生活随笔為你收集整理的9.10 nohup:用户退出系统进程继续工作的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。