1. Home
  2. Computing & Technology
  3. Linux
Basic Linux Operations FAQ

Part 3 of The Linux Newbie Administrator Guide

3.3.1 How do I execute a command in the "background"?
(continued after the ads...)

Related Resources
Linux Newbie Administrator Guide
0. Linux Benefit
1. Before Installation
2. Linux Resources/Help
3. Basic Operations FAQ
4. Newbie Admin FAQ
~ 4.1 Lilo
~ 4.2 Drives
~ 4.3 X-Windows
~ 4.4 Configurations
~ 4.5 Networking
5. Shortcuts / Commands
6. Linux Applications
7. Learn Linux Commands
A. How to Upgrade Kernel?

Using the "&" at the end of the command. For example, this will start licq (an icq client) in the x-terminal in the background, so that after issuing the command, my x-terminal is not blocked:

licq &

The process identification number, job_number, is printed on the screen, so you can use it with related commands. The related commands are fg job_number (="foreground", bring the background process back to my immediate view/control, restart it if it was stopped), bg job_number (="background", send the process to the background, restart if it was stopped, exactly as if it was started using &), z (send the current foreground process to the background and stop it), jobs (list the active jobs), kill process_ID (terminate the process, use the conmmand ps to find the process_ID of the process to kill).

To make a background process keep running after you disconnect, you may use the nohup (="no hungup"), for example:

nohup make &

that maybe compiling a large program.

Next > 3.3.2 How do I execute a command at specified time (using "at" or "batch")?

Can't find what you are looking for?
Search the

Stay up-to-date!
Subscribe to the Linux free newsletter.

Explore Linux

More from About.com

  1. Home
  2. Computing & Technology
  3. Linux

©2008 About.com, a part of The New York Times Company.

All rights reserved.