Fedora notes

Sunday, February 27, 2005

Job/Process control

Running a job in the background is typically done when its execution is expected to take a long time and in order to free the issuing terminal after entering the command. (Some processes are not suitable for running in the background, such as text editors, which occupy the full console or terminal window screen.) Starting a program in the background is accomplished by typing its name followed by a space and an ampersand. For example, typing

gftp &
at the command line starts gftp, an open source FTP (file transfer protocol) program, in the background. This frees the console or terminal window for use by other commands while gftp is downloading or uploading programs.

A process that is running in the foreground can be suspended by pressing CTRL+z and can be terminated by pressing CTRL+c. The command bg reactivates a suspended program in the background, and the command fg puts a suspended program or a program that is running in the background into the foreground. The command jobs shows a list of jobs with its jobid that can be used in bg and fg.


Post a Comment

<< Home