Run Linux commands in the background

Source: Internet
Author: User

Although Linux is a multi-task operating system, it does not provide multiple windows like windows, which means you must always operate multiple windows in the same terminal.ProgramOf course, modern Linux operating systems usually use remote terminals to connect to Linux servers to achieve multi-window and multi-task Linux operations, but one day you will encounter the need to manipulate Linux terminals, it is necessary to learn how to run Linux programs in the background, such as installing software and executing long-term tasks. At this time, you can leave a space behind the command and add &, such as installing rails

Gem install rails &

OK. Now you can call it to operate in the background, and then use BG, FG, and jobs to view and manipulate it. But even if it runs in the background, it will continuously output the installation information, which will affect you. one way to operate Linux is to redirect the output information to the log file, where to put it, such

Gem install rails> install_rails.log &

OK. In this way, you will not be disturbed by your normal work in the background, but it will always be so annoying, because the information is not always needed, and you need to process useless log files in the future. you can save it to the/dev/null file. This file is a bottomless directory. It will automatically erase the output information and throw the information to the garbage processing site, haha,

Gem install rails>/dev/Null&

OK, so that the installer can quietly execute its own tasks ~

 

P.s.: unless an error occurs during installation, an error message will be displayed on the screen. If you do not want to view the error message, you can add 2> & 1 at the end so that the error message will not be displayed. however, it is generally not recommended to do this. If the software fails to be installed successfully, I don't know what else it means.

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.