Nohup Program Name & (causes the program to run in the background, even if the terminal is closed, the program is still running)

Source: Internet
Author: User

ishallbethatishallbe:~ iamthat$ ps-ef |grep Ping  502     1   0  9:30PM??         0:00.05 Ping www.baidu.com  502   492   475   0  9:32pm ttys000    0:00.00 grep  pingishallbethatishallbe:~ iamthat$ kill-9 502-bash:kill: (502)-No such processishallbethatishallbe:~ iamthat$ kill-9 450ishallbethatishallbe:~ iamthat$ ps-ef |grep Ping  502   495   475   0  9:33pm ttys000    0:00.00 grep Ping First I here kill ping Baidu process re-demo

Create program: ishallbethatishallbe:~ iamthat$ nohup ping www.baidu.com >> ping.txt &[1] 507      

Close the terminal and reopen a terminal

Last login:wed Apr  1 21:37:38 in ttys000ishallbethatishallbe:~ iamthat$ tail-f ping.txt 33.108 bytes from 180.97. icmp_seq=76 ttl=54 time=48.586 ms64 bytes from 180.97.33.108:icmp_seq=77 ttl=54 time=46.160 ms64 bytes from 180.97.33.10 8:icmp_seq=78 ttl=54 time=48.099 ms64 bytes from 180.97.33.108:icmp_seq=79 ttl=54 time=44.345 ms64 bytes from 180.97.33. 108:icmp_seq=80 ttl=54 time=47.058 ms64 bytes from 180.97.33.108:icmp_seq=81 ttl=54 time=44.917 ms64 bytes from 180.97.3 3.108:icmp_seq=82 ttl=54 time=44.886 ms64 bytes from 180.97.33.108:icmp_seq=83 ttl=54 time=47.997 ms64 bytes from 180.97 .33.108:icmp_seq=84 ttl=54 time=45.928 ms64 bytes from 180.97.33.108:icmp_seq=85 ttl=54 time=46.988 ms64 bytes from 180. 97.33.108:icmp_seq=86 ttl=54 time=44.337 ms64 bytes from 180.97.33.108:icmp_seq=87 ttl=54 time=48.580 ms

The program is still running in the output.

Can see that 507 of the process has been running 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    

Nohup Program Name & (causes the program to run in the background, even if the terminal is closed, the program is still running)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.