From 75a4a592e5ccda30715f93563d741b83e0dcf39e Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Mon, 25 Apr 2011 13:37:00 +0000 Subject: Slackware 13.37 Mon Apr 25 13:37:00 UTC 2011 Slackware 13.37 x86_64 stable is released! Thanks to everyone who pitched in on this release: the Slackware team, the folks producing upstream code, and linuxquestions.org for providing a great forum for collaboration and testing. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. As always, thanks to the Slackware community for testing, suggestions, and feedback. :-) Have fun! --- slackbook/html/process-control-foregrounding.html | 138 ++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 slackbook/html/process-control-foregrounding.html (limited to 'slackbook/html/process-control-foregrounding.html') diff --git a/slackbook/html/process-control-foregrounding.html b/slackbook/html/process-control-foregrounding.html new file mode 100644 index 000000000..7b185ba74 --- /dev/null +++ b/slackbook/html/process-control-foregrounding.html @@ -0,0 +1,138 @@ + + + + +Foregrounding + + + + + + + + + + + +
+

11.2 Foregrounding

+ +

If you need to interact with a backgrounded process, you can bring it back into the +foreground. If you've only got one backgrounded process, you can bring it back by +typing:

+ + + + + +
+
+% fg
+
+
+ +

If the program is not done running, the program will take control over you terminal +and you will not be returned to a prompt. Sometimes, the program will finish running +while backgrounded. In this instance, you'll get a message like this:

+ + + + + +
+
+[1]+  Done              /bin/ls $LS_OPTIONS
+
+
+ +

That tells you that the backgrounded process (in this case ls +- not terribly interesting) has completed.

+ +

It is possible to have several processes backgrounded at once. When this happens, +you'll need to know which process you want to bring back to the foreground. Just typing +fg will foreground the process that was last backgrounded. What +if you had a whole list of processes in the background? Luckily, bash includes a command +to list all the processes. It's called jobs and gives output +like so:

+ + + + + +
+
+% jobs
+[1]   Stopped                 vim
+[2]-  Stopped                 amp
+[3]+  Stopped                 man ps
+
+
+ +

This shows you a list of all the processes that are backgrounded. As you can see, they +are all stopped. This means that the processes are suspended. The number is a sort of ID +for all the backgrounded processes. The ID with a plus sign beside it (man ps) is the process that will be foregrounded if you just type +fg.

+ +

If you wanted to foreground vim, you would type:

+ + + + + +
+
+% fg 1
+
+
+ +

and vim would spring back up to the console. Backgrounding +processes can be very useful if you only have one terminal open over a dialup connection. +You can have several programs running on that one terminal, periodically switching back +and forth between them.

+
+ + + + + -- cgit v1.2.3