Table of Difference between grep and pdfgrep
Grep | pdfgrep |
---|---|
It works only on plain text files. | It works only on pdf files. |
It is a default package. | It is not a default package but can be downloaded from the repository. |
It operates on lines. | It operates on pages. |
-n option is to show the line number | -n option is to show the page number. |
pdfgrep Command in Linux
Grep is a powerful tool to search for a pattern or regular expression in a text file but it cannot do the search in pdf files and that’s where pdfgrep comes into the picture. It’s a simple command used to search PDF files for a regular expression. In this article, we will discuss about the pdfgrep command and its usage.
Syntax:
Usage: pdfgrep [OPTION]... PATTERN FILE...