Learn how to compress PDFs in Linux to reduce file size.

A young black woman using a desktop computer to compress a PDF in Linux to reduce file size.

Learn how to reduce the file size of PDFs on your Linux device using the command line and online resources.

Multi-page PDFs can quickly become too big to email or upload. Luckily, there are a few ways you can compress files to make it easier to handle larger PDFs. Here are the best ways to compress a PDF with Linux.

Linux PDF compression with command line utilities.

If you run Debian or Ubuntu, you can compress PDFs with the Ghostscript command line tool. Ghostscript is software that interprets and compresses certain file types, so your Linux device can read and edit PDFs.

When at work or school, or if you are writing a book, you may want to scan documents and then save them as PDFs. Sometimes these PDFs can be too big or take up too much space on your device, which can make them impractical to send via email or upload to the cloud. Ghostscript can help you compress your PDFs so they are easier to share and store.

Compress PDFs with Ghostscript on Linux.

To compress your PDFs with Ghostscript on Linux, simply follow these steps:

  1. Install Ghostscript with the command sudo apt install ghostscript.
  2. Once installed, you can use this command to compress PDF file sizes:
  1. In the command, replace output.pdf and input.pdf with your chosen filenames. The “dPDFSETTINGS” is where you’ll choose the file size.
  2. Change the suffix =/screen to suit your needs:
  1. Once you input your preferences, simply run the command. Your new compressed PDF will be saved in the same folder as the original.

How to open a PDF file in Linux command line.

If you are wanting to open or view a PDF file while working from the Linux command line, you will need to launch or install Evince on your Linux computer system. Evince is the application that Ubuntu — a Linux operating system — defaults to as its PDF reader.

If you do not have Evince installed on your Linux computer system, you will need to enter the appropriate command line for your operating system version:

Once Evince is installed on your computer system, you will need to follow these steps to view or open a PDF file from the Linux command line:

  1. Go to the directory and enter the command line: $ cd downloads. By entering this command, Evince will open for operation.
  2. Type the command line: $ evince file.pdf. You can also enter: $ evince /Downloads/file.pdf.
  3. Your PDF will open up and be ready for viewing.

Use an online PDF compressor.

If you’re not comfortable with using the command line, the easiest way to compress a PDF is with an online PDF editor like Adobe Acrobat online services. Simply visit the Acrobat online services website from any web browser and follow three simple steps:

  1. Navigate to the compress PDF tool.
  2. Upload your file.
  3. Select the PDF to compress.
  4. Download the compressed file to your device.

The online PDF editor will compress the file without losing quality, and you won’t need to download software or enter commands. Another option is to split a PDF into separate files in Linux to isolate the relevant pages.

Discover more about how Acrobat and Acrobat online services can simplify compressing PDFs online from your Linux device.