Vous regardez une version antérieure (v. /pages/viewpage.action?pageId=115288104) de cette page.

afficher les différences afficher l'historique de la page

« Afficher la version précédente Vous regardez la version actuelle de cette page. (v. 5) afficher la version suivante »

When you type commands in a login shell (window/terminal) and see a response displayed, you are working interactively. This is the most common way of working. The main downsides are that one cannot disconnect while a process is running (it would get terminated) and if many users run many jobs interactively the computer might get "overworked", slowing down all processes. Therefore, it is sometimes more practical to send jobs in the background or to submit batch jobs.

Background processes

Send a job/process in the background

Processes that open windows like emacs, Matlab, xrec, xxdiff and others block further usage of the terminal (window) from which they were opened. To be able to continue using the terminal for other things one can send such processes in the background. Either right away by adding a '&' at the end of the command. For example:

emacs filename &
matlab &


If you forgot to at the '&' but still like to continue using the terminal you can send the process in the background with the commands:

    Ctrl-Z
followed by
    bg
(for background)


It is also possible to send commands like rsync in the background with:

    rsync [keys] source destination  > logfile 2>&1 &

The logfile will contain the output of rsync which usually appears on the screen.

Check running processes

Once a process which did not open it's own window is running in the background you cannot see it anymore in the terminal from which you started it. To see processes running in the background (as well as all other processes) you can use the command 'ps'. For example:

    ps -fu username

To get more information about 'ps' execute the command : man ps

Another way to see all running processes is with 'top'. For example:

    top -u username

Kill a background process

Once a process is running in the background you cannot terminate it anymore with Ctrl-C or Ctrl-D. If the process you sent in the background has its own window you can kill the window and with that usually the process. But if you sent a process in the background which does not have a window you do not even see it anymore in the terminal from which you started it. But you can see it with 'ps' or 'top' - see above.
Once you found the process you want to terminate you can kill it with:

    kill -9 Job-ID


Batch processes

Submit a batch job


  • Aucune étiquette