-
killall Kill a process by it's name, uses names instead of process id's (pids). Use -v to have killall report whether the kill was successful or not and -i for
interactive mode (will prompt you before attempting to kill).
|
pkill - a little like a killall with regular expressions |
|
pkill is another command that allows processes to be killed but does so using regular expressions. See below for more information.
|
For example:
Would kill anything named "mozilla" and prompt you before each kill and report whether the kill was successful or not. Unfortunately you need to get the name exactly right for killall to
work, you would need to use "mozilla-bin" to kill the mozilla browser. If you want something where you don't need to know the exact name try pkill (below).
-
pkill pkill is used to kill processes according to an extended regular expression. Use the -u option to kill using a user name(s) and process name (for example to only kill a
process of a certain user). pkill can also send specific signals to processes.
For normal usage simply type:
Note that the "process_name" doesn't have to be an exact match...
Or to kill the "process_name" of only the users "fred" and "anon" type:
pkill -u fred anon process_name
|
- skill
-
skill is used to send a command/username/tty a particular signal.
skill has a number of options available to ensure correct interpretation (otherwise it just guesses what it is), simply type skill -option(s)
-
-L --- list the various signals that can be sent
-
-u --- specify a username; this is obviously followed by the user name or a space-seperated list of usernames.
-
-p --- process id (followed by the process id)
-
-c --- command name (this is the same as killall)
-
-t --- (tty number)
-
-v --- verbose mode
-
-i --- interactive mode.
skill can be used to stop, continue, or kill processes using the username, command name or process id (or send them any variety of signals you like).
Useful example:
skill -STOP abusive_user_name
|
The above command will stop all of that users processes, this will cause his screen to freeze until you type:
skill -CONT abusive_user_name
|
This would tell that all processes may continue as before. Note that this would only work if you are root. Also note you can list more than one user name with the command so it will apply to
multiple users.
- CTRL-C
-
The break key, will kill (break, stop) something that's running on your terminal.
-
jobs Prints currently running jobs, as in processes you have executed within the shell.
-
bg Backgrounds a process. To start a program in the background (so it doesn't take over the terminal) use an "&" (ampersand) sign at the end of the command. You usually use CTRL-Z to suspend something you are currently using. You can simply use bg to resume in the background the last job suspended...
Command syntax:
or
-
fg Bring a process to the foreground, so you can interact with it. The process will use your current terminal. Note simply use fg to foreground the last job number suspended...
You can bring jobs to the foreground by name or by number (use jobs to find the number).
Command syntax:
or
-
nice Sets the priority for a process. nice -20 is the maximum priority (only administrative users can assign negative priorities), nice 20 is the minimum priority. You must be
root to give a process a higher priority, but you can always lower the priority of your own processes...
Example:
Would execute make and it would run at maximum priority.
-
renice Changes the priority of an existing command. You may use the options -u to change the priorities of all processes for a particular user name and -g to change priorities
for all processes of a particular group. The default is to change via the process id number.
Example:
This would change the priority of process 2222 to +20 (minimum priority).
-
snice snice works very similarly to skill, only it changes the priority of the process(es). Its function is similar to that of renice.
To use options (to ensure correct interpretation) you simply type snice -option(s):
-
-u --- specify a username; this is obviously followed by the user name or a space-seperated list of usernames.
-
-p --- process id (followed by the process id)
-
-c --- command name (this is the same as killall)
-
-t --- (tty number)
-
-v --- verbose mode
-
-i --- interactive mode.
Example:
This would increase the priority of all root's processes.