brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: lpstat -o shows what is stuck in the Mac print queue

Terminal
~/tips/tip-macos-lpstat-print-queue

lpstat -o

Lists the queued print jobs and printer status from the Mac terminal.

When a print job just sits there, I want to see the queue without clicking through printer windows.

CUPS, the print system behind macOS, comes with lpstat. Run on its own it lists the active jobs you queued. With -o it shows the jobs on all destinations, or on the printers you name:

lpstat -o

By default it lists the jobs that are not completed. To see the finished ones, put -W completed in front of the -o:

lpstat -W completed -o

A few more flags from the man page:

  • lpstat -p shows the printers and whether they are enabled for printing
  • lpstat -d shows the default destination
  • lpstat -v shows which device each printer is attached to
  • lpstat -r shows whether the CUPS server is running
  • lpstat -t shows all status information at once

For a long listing of jobs, add -l. -u lists the jobs of the users you name, and -R shows the ranking of the print jobs.

The caveat is the order of options. The man page says -W must appear before -o and before any printer names, otherwise the default of not-completed is used. Also, lpstat only reads. To clear a stuck job you need another tool, and the man page lists cancel(1) under See Also, so read that page before you remove anything.

Further reading: lpstat man page (CUPS)

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link