Retrieve all files ever printed on a Mac computer!
Go to file
Adam Sroka 371883cb65
docs(readme): update blog link
2022-11-24 07:52:37 +00:00
LICENSE docs: add license and info about it 2022-11-14 23:19:46 +00:00 docs(readme): update blog link 2022-11-24 07:52:37 +00:00 fix: failsafe cd exit and dont inject filename 2022-11-15 12:27:07 +00:00 docs: update todos 2022-11-16 13:54:59 +00:00

Retrieve Printed Files on Mac 🖨🗂

What is this?

This script will retrieve information (e.g. name, time of printing) about all files ever printed on your Mac1, and possibly also the original files, even if they've been deleted.

How do I do it?

Download this repository from here, unzip it, open up terminal in the folder with it, and run the python script as root, i.e. run:

sudo python

This will create a new folder with all retrieved files and a csv file with information about every file ever printed, even if the file itself could not be recovered.

Security sidenote

Root privileges are needed to access the protected directory where the print history is stored. Feel free to examine the python script before running it; it's only about a hundred lines.

Alternatively, you can also run the bare-bones shell script from this repo, which only has four commands and just copies the whole folder with the print history and tries to rename the files to pdfs. Do so by running sudo bash

How does this work?

MacOS uses a printing system called CUPS, which is configured to save printed files by default in many cases. This means that if you print a file on your Mac and then delete it, it is likely that Mac has saved a copy of that file in an internal CUPS folder. This script just copies that file back, finds its name, renames it, and also retrieves some other information from CUPS control files. You can read more in my blog about this.


Thanks for go-cups-control-files and for How to dissect a CUPS job control file; this would not exist without these.


The scripts are licensed under the GNU General Public License v3.0.

  1. And also on any other Linux system using CUPS, Apple's open-source system for printing. ↩︎