Problem
When I do "lpstat -o" (or "lpstat -t") I show several print jobs in the queue and I want to cancel all of them. I do not want to cancel them one at a time.
Solution
Use one of the following commands to cancel all print jobs. At the command line type:
1) lpstat -o | awk '{print $1}' | xargs cancel2) lpstat -o | while read a b; do cancel $a; doneIf you wish to cancel all jobs for a specific printer
or class, include that name after the -o option. For
example, if you wish to cancel all jobs for printer
"myprinter", type:lpstat -omyprinter | awk '{print $1}' | xargs cancelor lpstat -omyprinter | while read a b; do cancel $a; doneNOTE: The above commands demonstrate two different shell script styles of doing the same thing.