示例: [root@iZ25k9j42dlZ home]# nohup wget https://www.jianshu.com/p/48a65d33760d nohup: ignoring input and appending output to `nohup.out'
方式二:setsid
setsid 的使用也是非常方便的,也只需在要处理的命令前加上 setsid 即可。
示例: [root@iZ25k9j42dlZ home]# setsid ping www.baidu.com [root@iZ25k9j42dlZ home]# PING www.a.shifen.com (220.181.112.244) 56(84) bytes of data. 64 bytes from 220.181.112.244: icmp_seq=1 ttl=54 time=3.22 ms 64 bytes from 220.181.112.244: icmp_seq=2 ttl=54 time=3.22 ms 64 bytes from 220.181.112.244: icmp_seq=3 ttl=54 time=3.22 ms 64 bytes from 220.181.112.244: icmp_seq=4 ttl=54 time=3.15 ms 64 bytes from 220.181.112.244: icmp_seq=5 ttl=54 time=3.19 ms 64 bytes from 220.181.112.244: icmp_seq=6 ttl=54 time=3.22 ms ^C [root@iZ25k9j42dlZ ~]# ps -ef|grep ping root 8003 1 0 10:05 ? 00:00:00 ping www.baidu.com root 8020 8004 0 10:06 pts/2 00:00:00 grep ping
方式三:&
在命令结尾添加 & 即可。
示例: [root@iZ25k9j42dlZ ~]# ping www.baidu.com & [1] 8053 [root@iZ25k9j42dlZ ~]# PING www.a.shifen.com (220.181.11