How-To GuidesMarch 24, 2026
Meidy Baffou·LazyPDF

How to Split PDF Files on Linux Using the Terminal

Splitting PDFs on Linux is a task where the command line genuinely excels. Unlike GUI applications that require point-and-click page selection, terminal tools let you specify exact page ranges in a single command, split multiple documents in parallel with shell scripts, and integrate PDF splitting into automated workflows. Linux has several excellent tools for PDF splitting. pdftk offers the most versatile syntax for complex page range operations. pdfseparate (from poppler-utils) is the simplest option for splitting every page into individual files. Ghostscript provides splitting with control over output quality and compression. And for quick, one-off splits, browser-based tools like LazyPDF in Firefox or Chromium handle it without any setup. This guide provides practical, copy-paste-ready commands for every PDF splitting scenario you'll encounter on Linux. Each tool is covered with installation instructions and multiple usage examples. Whether you need to extract specific pages, split a document into chapters, or separate every page into individual files, you'll find the right command here. Understanding these tools also helps you build more sophisticated document processing workflows — PDF splitting is often just one step in a larger pipeline that might also include OCR, compression, or format conversion.

Split PDF on Linux Using pdftk

pdftk's cat and burst operations cover the most common splitting scenarios on Linux. Here are the most useful commands:

  1. 1Install pdftk: `sudo apt install pdftk` (Ubuntu/Debian) or `sudo dnf install pdftk` (Fedora).
  2. 2Extract specific pages (e.g., pages 1-5): `pdftk input.pdf cat 1-5 output pages_1_to_5.pdf`
  3. 3Extract a single page: `pdftk input.pdf cat 3 output page_3.pdf`
  4. 4Extract multiple non-consecutive pages: `pdftk input.pdf cat 1 5 7 10-15 output selected.pdf`
  5. 5Split into individual pages (burst): `pdftk input.pdf burst output page_%04d.pdf` — creates page_0001.pdf, page_0002.pdf, etc.

Split PDF on Linux Using pdfseparate (poppler-utils)

pdfseparate is part of the poppler-utils package and provides a clean, simple interface specifically designed for extracting pages from PDFs. Install it with `sudo apt install poppler-utils`. The basic syntax is: `pdfseparate input.pdf output-%d.pdf` This splits every page into individual files named output-1.pdf, output-2.pdf, and so on. To split only a specific page range, use the `-f` (first) and `-l` (last) flags: `pdfseparate -f 3 -l 8 input.pdf chapter_%d.pdf` This extracts pages 3 through 8 from the document, creating chapter_3.pdf through chapter_8.pdf. This is particularly clean because pdfseparate doesn't re-encode content — it extracts pages directly, preserving exact quality and metadata. For a script that splits many PDFs in a directory, pdfseparate works well in a loop: ```bash for f in *.pdf; do mkdir -p "${f%.pdf}_pages" pdfseparate "$f" "${f%.pdf}_pages/page_%d.pdf" done ```

Split PDF on Linux Using Ghostscript

Ghostscript can extract page ranges with fine control over the output quality. The key flags for splitting are `-dFirstPage` and `-dLastPage` which define the page range to extract: `gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dFirstPage=6 -dLastPage=12 -sOutputFile=section.pdf input.pdf` This extracts pages 6 through 12 into `section.pdf`. The advantage of ghostscript for splitting is that you can simultaneously apply compression or quality settings. If you're splitting a large scanned document and want to compress each section, ghostscript handles both operations in one command: `gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=10 -dPDFSETTINGS=/ebook -sOutputFile=section1.pdf input.pdf` The `-dPDFSETTINGS=/ebook` flag applies balanced compression to the output, reducing file size while maintaining good screen quality.

Automating PDF Splitting on Linux With Shell Scripts

The real power of Linux PDF splitting emerges when you combine these tools with shell scripting. Here's a practical example: splitting a directory of monthly report PDFs into individual chapters based on page counts. If you know each report has 5-page chapters, this script creates chapter files automatically: ```bash #!/bin/bash for pdf in reports/*.pdf; do name=$(basename "$pdf" .pdf) total=$(pdftk "$pdf" dump_data | grep NumberOfPages | awk '{print $2}') for ((page=1; page<=total; page+=5)); do end=$((page+4)) [ $end -gt $total ] && end=$total pdftk "$pdf" cat $page-$end output "chapters/${name}_ch$((page/5+1)).pdf" done done ``` This kind of automation is impossible with GUI tools and trivial with Linux command-line tools — it's one of the reasons Linux is the preferred platform for document processing workflows in data science, publishing, and systems administration. For simpler automation, a quick Makefile or cron job using pdftk or pdfseparate handles recurring split tasks with zero manual intervention.

Frequently Asked Questions

What's the fastest way to split a PDF on Linux for a one-off task?

For a single quick split without wanting to open a terminal, use LazyPDF in Firefox or Chromium — drag in the PDF, specify the split, and download. For terminal users, pdfunite or pdfseparate from poppler-utils gives the quickest result for single extractions.

How do I split a PDF into specific page ranges on Linux?

pdftk gives the most control. Use: `pdftk input.pdf cat 1-10 output part1.pdf` for pages 1-10, and `pdftk input.pdf cat 11-20 output part2.pdf` for pages 11-20. Run multiple commands to extract different ranges. Non-consecutive pages work too: `pdftk input.pdf cat 1 3 5 7 output odd_pages.pdf`.

Can I split a PDF on Linux without root/sudo access?

Yes, if the tools are already installed. If they're not, use a browser-based tool like LazyPDF in Firefox — no installation required, everything runs in the browser. Alternatively, you can compile pdftk from source into a home directory, or use the AppImage version if available for your distro.

Will splitting preserve PDF bookmarks and metadata on Linux?

pdftk preserves page content but may not carry over all document-level metadata or bookmarks to each split section. pdfseparate from poppler-utils similarly focuses on page content. Ghostscript may strip some metadata. For documents where bookmarks are critical, verify the output carefully after splitting.

Need to split a PDF quickly on Linux without the terminal? Use LazyPDF in your browser — free and instant.

Try It Free

Related Articles