# How do I compress PDF command line without installing extra software?

**URL:** <https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131>\
**Category:** Desktop vs Online\
**Tags:** encryption\
**Created:** [November 12, 2026, 4:29pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131 "2026-11-12T16:29:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![PatriciaCalebClark](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/p/b5a626/32.png) [@PatriciaCalebClark](https://forum.sejda-pdf.net/u/PatriciaCalebClark)\
**Post date:** [November 12, 2026, 4:29pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/1 "2026-11-12T16:29:23Z")

</div>

I am on a locked-down work machine where I cannot install third-party packages, but I need to shrink a 50MB PDF using the terminal. Is there a built-in command-line tool that can compress it natively?

---

<div class="post-metadata">

**Author:** ![throwaway\_340232](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/t/858c86/32.png) [@throwaway\_340232](https://forum.sejda-pdf.net/u/throwaway_340232)\
**Post date:** [November 12, 2026, 4:29pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/2 "2026-11-12T16:29:26Z")

</div>

There really isn’t a built in tool for this on most systems. On Mac you can try a Quartz filter through the terminal, and on Linux Ghostscript is sometimes already installed if you check with `gs --version`. What OS is the work machine running?

---

<div class="post-metadata">

**Author:** ![sharon\_1980](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@sharon\_1980](https://forum.sejda-pdf.net/u/sharon_1980)\
**Post date:** [November 13, 2026, 10:23pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/3 "2026-11-13T22:23:15Z")

</div>

Depends what’s already on the machine. Often Ghostscript is there even when you can’t install anything, and then gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o out.pdf in.pdf does the shrinking from terminal. Which OS is it, and is that 50MB mostly scanned images or real text? If it’s scans, compression mostly means downsampling images, and the settings matter a lot.

---

<div class="post-metadata">

**Author:** ![aoife\_miami](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/a/ecd19e/32.png) [@aoife\_miami](https://forum.sejda-pdf.net/u/aoife_miami)\
**Post date:** [November 15, 2026, 10:53am UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/4 "2026-11-15T10:53:11Z")

</div>

If you’re on Windows, I don’t think there’s a true built in terminal command for that. On Mac there is a sips/Preview trick using Automator or Quartz filters that doesn’t need installs, worth a search for your exact OS version.

---

<div class="post-metadata">

**Author:** ![Samantha1986](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@Samantha1986](https://forum.sejda-pdf.net/u/Samantha1986)\
**Post date:** [November 16, 2026, 12:08pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/5 "2026-11-16T12:08:21Z")

</div>

Had a similar thing happen last year on a locked laptop. I am not great with the terminal, so I learned the hard way that it is usually easier to just split the file into smaller parts if size is the issue. Not sure if it works the same on Windows, but that got around my file limits.

---

<div class="post-metadata">

**Author:** ![NaomiSanders](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/n/e19b73/32.png) [@NaomiSanders](https://forum.sejda-pdf.net/u/NaomiSanders)\
**Post date:** [November 17, 2026, 5:38pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/6 "2026-11-17T17:38:15Z")

</div>

I ran into this on a locked-down machine too. There isn’t a built-in, cross-platform command-line tool that reliably compresses PDFs; Windows in particular has no native PDF compressor. If your workplace allows it, an online PDF compressor is probably the simplest option, otherwise ask IT to provide Ghostscript or a managed compression tool.

---

<div class="post-metadata">

**Author:** ![MarkAdams](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@MarkAdams](https://forum.sejda-pdf.net/u/MarkAdams)\
**Post date:** [November 19, 2026, 4:38am UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/7 "2026-11-19T04:38:26Z")

</div>

@sharon_1980 Checking for scanned images first is exactly what I would do.

If a document is mostly image scans, compressing it too much ruins the text quality. I always look at the resolution before trying to shrink anything.

---

<div class="post-metadata">

**Author:** ![adam.green](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@adam.green](https://forum.sejda-pdf.net/u/adam.green)\
**Post date:** [November 20, 2026, 11:08am UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/8 "2026-11-20T11:08:14Z")

</div>

@Samantha1986 Splitting worked for me too when a big tax packet kept bouncing back by email. One thing to check though: if the recipient needs the whole document as one PDF, splitting just moves the problem along. Also if the file is a form with fillable fields, make sure the page with the fields stays intact before you send it.

---

<div class="post-metadata">

**Author:** ![wallabies\_boss](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/w/a87d85/32.png) [@wallabies\_boss](https://forum.sejda-pdf.net/u/wallabies_boss)\
**Post date:** [November 21, 2026, 5:23pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/9 "2026-11-21T17:23:36Z")

</div>

@adam.green That email bounce problem is annoying. Splitting can work for size limits but it is messy if they need one file. I have had quotes bounce too. On locked machines there is often nothing built in. Not sure if it’s the same on Mac.

---

<div class="post-metadata">

**Author:** ![carl.1965](https://forum.sejda-pdf.net/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@carl.1965](https://forum.sejda-pdf.net/u/carl.1965)\
**Post date:** [November 22, 2026, 4:23pm UTC](https://forum.sejda-pdf.net/t/how-do-i-compress-pdf-command-line-without-installing-extra-software/131/10 "2026-11-22T16:23:16Z")

</div>

First thing I’d check is whether ghostscript is already on there, run gs --version. Lots of machines ship with it, and gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook shrinks files well. If it’s missing, nothing truly native exists, so I’d just use [pdfcap.com](http://pdfcap.com) instead.
