In the "view queue" GUI of my printer, I can click "show all completed jobs" and get the columns

Job|User|Document|Printer|Size|Time Submitted|Status

I hunted around for some way of doing this in the terminal and got close to what I wanted but not quite. When I execute lpstat -W completed, I get

HP-LaserJet-9050-121    alex             94208   Mon 06 Apr 2015 05:52:10 PM EDT
HP-LaserJet-9050-122    alex            160768   Mon 06 Apr 2015 05:53:14 PM EDT
HP-LaserJet-9050-123    alex             44032   Mon 06 Apr 2015 05:53:32 PM EDT

While this sort of does the job, I do need the "Document" column equivalent. I am wondering if there is a way to do this specifically from the terminal?

Edit:The "Document" column displays the title of the prints


The directory /var/log/cups contains all the logs and page_log contains the information you need. Depending on your log rotation and how far in the past you want to be able to do this, it'll take a:

cat /var/log/cups/page_log

or for just the LaserJet-9050 jobs:

grep 9050 /var/log/cups/page_log

You might have to edit cupsd.conf and change the default ´PageLogFormat before the log files start being populated.

  • I tried cat /var/log/cups/page_log but it's empty... – Alex H Apr 13 '15 at 23:36
  • It means you haven't printed anything lately and/or it has been rotated in the mean time. Unzip /var/log/cups/page_log.1.gz and look there... – Fabby Apr 14 '15 at 0:03
  • Hmm, there is no such file or directory... – Alex H Apr 18 '15 at 5:33
  • This is what's in the directory access_log access_log.4.gz error_log error_log.4.gz page_log access_log.1.gz access_log.5.gz error_log.1.gz error_log.5.gz access_log.2.gz access_log.6.gz error_log.2.gz error_log.6.gz access_log.3.gz access_log.7.gz error_log.3.gz error_log.7.gz – Alex H Apr 18 '15 at 5:34
  • 1
    By default PageLogFormat is set to empty in cupsd.conf resulting into no updates made to page_log file. – reddot Apr 18 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.