[K12OSN] cancel print jobs

Brian Chivers brian at portsmouth-college.ac.uk
Fri Jan 13 14:41:23 UTC 2006


Will Hatch wrote:
> Hi all,
> 
> This might be a bit off topic; how do you cancel all print jobs from the
> command line?  I have some students that think if you continue to click
> "print" that their assignment will eventually appear from the printer.
> I assume you have to be logged in as root.  Then what? Thanks!
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 
I use this on the printserver

for i in `lpstat -o|grep printername|awk '{print $1}'`; do cancel $i; done

So if your printer was called `bigprinter` you'd have

for i in `lpstat -o|grep bigprinter|awk '{print $1}'`; do cancel $i; done


I've actually set this up as a custom job in Webmin to make it easier to run.

Brian

---------------------------------------------------------------
    The views expressed here are my own and not necessarily 
                the views of Portsmouth College             




More information about the K12OSN mailing list