Putting Programs on Hold
- 0
- Add a Comment
- No Related Post
Putting Programs on Hold
There’s just so much you can do from a command line in Linux. I almost always
prefer command line execution to pointing and clicking on an icon. Aside from
the ability to execute a program with a unique and task-specific set of options,
there are other things you can do from the command line that just can’t be done
in a GUI.
For example, I know of no other way to put a running program on hold than
through a console window. How’s that done? It’s a quick two-step process.
First, you’ll need to find the Process ID (PID) of the program you want to put
on hold:
&nbp;ps xa | grep qtopiadesktop
This command looks through all the running processes for the string
“qtopiadesktop” and displays some details associated with that process:
3522 pts/3 S 0:00 grep
qtopiadesktop
The number to the far left is the PID. Now, you can use this number to “pause”
the program:
kill -STOP 3522
This looks a bit more heavy-handed than it actually is. By adding the -STOP
option to the kill command, you simply put a running program in sleep
mode rather than killing it altogether. kill has several options of this type,
including -HUP, which “hangs up” the process and restarts it in a single
command.
So, you’ve put the program in a holding pattern. How do you bring it back to an
active state?
kill -CONT 3522
You simply tell kill to continue [-CONT] process 3522. Works like a charm.
When you want to put a program on hold, don’t bother with a gui. The command
line can be an effective program lullaby.
