Skip to content

Instantly share code, notes, and snippets.

@drobbins
Created March 7, 2013 17:23
Show Gist options
  • Save drobbins/5109894 to your computer and use it in GitHub Desktop.
Save drobbins/5109894 to your computer and use it in GitHub Desktop.
How to clean up duplicate but unlinked PDF files from your Papers2 library.

Papers2 Library Cleanup

For a variety of reasons, my Papers2 library folder (~/Library/Application Support/Papers2) was cluttered with many duplicate papers, generally only one of which was linked to a document in Papers2. Here is how I cleaned it up.

  1. From a Terminal, cd ~/Library/Application\ Support.
  2. open .
  3. Copy the Papers2 folder to the Desktop. This is your backup.
  4. In Papers2, cmd+,, select Library, select Add next to "Rename files in library folder as:", and select Separator -> _ then click Apply.
  5. Back in your Terminal, find ./ -iregex ".*[^_]\.pdf" -delete
    • If you want to see what's going to be deleted before doing it, run find ./ -iregex ".*[^_]\.pdf"
  6. Back in Papers2, remove the _ from "Rename files in library folder as:", and click Apply again.

And thats it.

@rrojas80
Copy link

Thanks for your post. I have tried your solution but Papers2 does not rename the files in the library folder. Have you encounter this issue by any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment