Detailed Linux background running commands (4)

Source: Internet
Author: User

Running commands cron, crontab, at, and & in the Linux background run when the account is logged on. If you are not an administrator, you may want to exit the account, but if the process fails to run when it exits, this Linux background command will be very useful.

Nohug

If you are running a process and you think the process will not end when you exit the account, you can use the n o h u p command. This command can continue running the corresponding process after you exit the account. N o h u p means no hang up ).

The command is generally in the following format:

Code:

Nohup command &

Use the Linux background to run the command nohup to submit a job

If you use the n o h u p command to submit a job, all the output of the job is redirected to a job named n o h u p by default. unless the output file is specified separately in the o u t file:
Code:

Nohup command> myout. file 2> & 1

In the preceding example, the output is redirected to the m y o u t. f I l e file.

Let's take a look at an example to verify whether the job can continue running after you exit the account. We will first submit a log clearing process named p s 1:
Code:

$ Nobup ps1 &

Now exit the s h e l, log on again, and then execute the following command:
Code:

$ Ps x | grep ps1

We can see that the script is still running. If the system does not support the ps x command, run the ps-ef | grep ps1 command.

  1. Detailed command 1 for running Linux background)
  2. Detailed analysis of the use of Linux du commands
  3. Brief Introduction to Linux Firewall Configuration modification commands
  4. In-depth analysis of Linux partition Basics
  5. Differences between Linux and Unix

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.