Process and job control

Hit Squad

The pkill command, which is an abbreviation for the Linux "hit squad," understands the same options as pgrep, and is run against processes by specifying a signal in the same way as kill:

pkill -19 ssh

Another practical aspect is that system administrators can target another user's processes by setting the -u flag (see Listing 4). To do so, root simply passes in the username as an option.

Listing 4

-u flag

01 # pgrep -lfu petrosilie
02 7682 sleep 4000000000
03 7792 bash
04 [...]
05 # pkill -19 -u petrosilie

The Author

Heike Jurzik studied German, Computer Science and English at the University of Cologne, Germany. She discovered Linux in 1996 and has been fascinated with the scope of the Linux command line ever since. In her leisure time you might find Heike hanging out at Irish folk sessions or visiting Ireland.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: Processes

    Innumerable processes may be running on your Linux system. We’ll show you how to halt, continue, or kill tasks, and we’ll examine how to send the remnants of crashed programs to the happy hunting grounds.

  • Shell Scripts in Waiting: the Waitmax Tool

    Linux consultant Matthias Kettner has just released Version 1.0 of his Waitmax Software. It gives programs a specified time to complete after terminating them.

  • Parallel Bash

    You don't need a heavy numeric mystery to benefit from the wonders of parallel processing. This article describes some simple techniques for parallelizing everyday bash scripts.

  • Command Line – Killing Processes

    Linux offers a variety of tools for shutting down systems and processes. We describe some important commands.

  • System Status Tools

    A system monitor lets you query the system’s current health state. If you are unhappy with the spartan Top tool, try one of these easy alternatives.

comments powered by Disqus

Direct Download

Read full article as PDF:

089-091_command.pdf  (931.33 kB)

News