{"id":3875,"date":"2023-09-15T16:36:47","date_gmt":"2023-09-15T13:36:47","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3875"},"modified":"2023-09-15T08:10:12","modified_gmt":"2023-09-15T05:10:12","slug":"linux-how-to-search-text-in-a-pdf-file-via-command-line","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/","title":{"rendered":"Linux: How to search text in a PDF file via Command Line"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" data-attachment-id=\"3880\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/attachment\/search-text-in-a-pdf-file-via-command-line-png\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Search-text-in-a-PDF-file-via-Command-Line.png\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?fit=300%2C169&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?fit=750%2C422&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?resize=750%2C422&#038;ssl=1\" alt=\"How to search text in a PDF file via Command Line\" class=\"wp-image-3880\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Search-text-in-a-PDF-file-via-Command-Line.png.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>In this tutorial, we will explain how to search text in a PDF file using <a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-find-the-largest-files-in-linux\/\">Linux command-line options<\/a>. One of Linux&#8217;s many advantages is its command-line interface (CLI), which allows users to complete difficult tasks using short, text-based commands.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Linux_Basics\" title=\"Linux Basics\">Linux Basics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#The_Need_for_Search_Text_in_a_PDF_File\" title=\"The Need for Search Text in a PDF File\">The Need for Search Text in a PDF File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Linux_Command_Line_Tools_for_Search_Text_in_PDF_Files\" title=\"Linux Command Line Tools for Search Text in PDF Files\">Linux Command Line Tools for Search Text in PDF Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#pdfgrep\" title=\"pdfgrep\">pdfgrep<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#pdftotext\" title=\"pdftotext\">pdftotext<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Advanced_Search_Options\" title=\"Advanced Search Options\">Advanced Search Options<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Case-Insensitive_Search\" title=\"Case-Insensitive Search\">Case-Insensitive Search<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Recursive_Search\" title=\"Recursive Search\">Recursive Search<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Line_Number_Display\" title=\"Line Number Display\">Line Number Display<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/#Final_Thoughts\" title=\"Final Thoughts\">Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Linux_Basics\"><\/span>Linux Basics<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>It&#8217;s essential to understand what a PDF file is before we go into more detail. Adobe created the Portable Document Format (PDF) file type, that allows users to present and exchange documents with confidence regardless of the operating system, hardware, or software they are using. PDF files can contain not only text and images, but also interactive buttons, hyperlinks, embedded fonts, videos, and more.<\/p>\n\n\n\n<p>The Linux command line, also known as the <a href=\"https:\/\/virtono.com\/cloud-vps\" target=\"_blank\" rel=\"noopener\">terminal or shell<\/a>, is a text-based user interface used for executing commands. Unlike the graphical user interface (GUI), which uses windows, icons, and menus, the command line provides a more direct and powerful means of interacting with the operating system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"The_Need_for_Search_Text_in_a_PDF_File\"><\/span>The Need for Search Text in a PDF File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This &#8220;search text in a PDF file&#8221; functionality can save you time and effort, whether you&#8217;re a student searching for a specific topic in an e-book, a researcher looking for particular data in a report, or a developer seeking a specific function in a programming manual.<\/p>\n\n\n\n<p>While many PDF readers have a search feature, using multiple files requires opening each one separately, which can be time-consuming. This is where the Linux command line&#8217;s strength shines, as it provides a number of tools that can quickly and effectively search for text within PDF files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Linux_Command_Line_Tools_for_Search_Text_in_PDF_Files\"><\/span>Linux Command Line Tools for Search Text in PDF Files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Linux provides several command-line tools for text search in PDF files, including\u00a0<code>pdfgrep<\/code>,\u00a0<code>pdftotext<\/code>, and\u00a0<code>grep<\/code>. These tools are not typically installed by default, but they can be easily installed using the package manager of your Linux distribution.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"pdfgrep\"><\/span>pdfgrep<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><code>pdfgrep<\/code>\u00a0is a command-line utility specifically designed for searching text in PDF files. It works similarly to the\u00a0<code>grep<\/code>\u00a0command but is tailored for PDF files. Here is the basic syntax:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pdfgrep \"search term\" file.pdf<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"106\" data-attachment-id=\"3877\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/attachment\/screenshot-2023-09-15-at-07-59-34\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?fit=2154%2C306&amp;ssl=1\" data-orig-size=\"2154,306\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-15-at-07.59.34\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?fit=300%2C43&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?fit=750%2C106&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?resize=750%2C106&#038;ssl=1\" alt=\"Linux: How to search text in a PDF file via Command Line\" class=\"wp-image-3877\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?resize=1024%2C145&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?resize=300%2C43&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?resize=768%2C109&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?resize=1536%2C218&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-07.59.34.png?resize=2048%2C291&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>You can also search in multiple files or directories:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pdfgrep \"search term\" *.pdf\npdfgrep \"search term\" \/path\/to\/directory\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"pdftotext\"><\/span>pdftotext<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><code>pdftotext<\/code>\u00a0is a command-line utility that converts PDF files to plain text. Once the file is converted, you can use the\u00a0<code>grep<\/code>\u00a0command to search for a specific text. Here is how you can use\u00a0<code>pdftotext<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pdftotext file.pdf - | grep \"search term\"<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"144\" data-attachment-id=\"3878\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/attachment\/screenshot-2023-09-15-at-08-00-31\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?fit=1742%2C334&amp;ssl=1\" data-orig-size=\"1742,334\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-15-at-08.00.31\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?fit=300%2C58&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?fit=750%2C144&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?resize=750%2C144&#038;ssl=1\" alt=\"How to search text in a PDF file\" class=\"wp-image-3878\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?resize=1024%2C196&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?resize=300%2C58&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?resize=768%2C147&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?resize=1536%2C295&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.00.31.png?w=1742&amp;ssl=1 1742w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Advanced_Search_Options\"><\/span>Advanced Search Options<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Advanced search options like case-insensitive search, recursive search, and line number display are also available with these command-line tools. Your search can be tuned and made more effective by using these options.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Case-Insensitive_Search\"><\/span>Case-Insensitive Search<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>To perform a case-insensitive search, you can use the\u00a0<code>-i<\/code>\u00a0option:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pdfgrep -i \"search term\" file.pdf<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Recursive_Search\"><\/span>Recursive Search<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>To search recursively in a directory and its subdirectories, you can use the\u00a0<code>-r<\/code>\u00a0or\u00a0<code>-R<\/code>\u00a0option:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pdfgrep -r \"search term\" \/path\/to\/directory\/<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Line_Number_Display\"><\/span>Line Number Display<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>To display the line numbers of the matching text, you can use the\u00a0<code>-n<\/code>\u00a0option:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pdfgrep -n \"search term\" file.pdf<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"136\" data-attachment-id=\"3879\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/attachment\/screenshot-2023-09-15-at-08-02-01\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?fit=1760%2C320&amp;ssl=1\" data-orig-size=\"1760,320\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-15-at-08.02.01\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?fit=300%2C55&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?fit=750%2C136&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?resize=750%2C136&#038;ssl=1\" alt=\"search text in a PDF file via Command Line\" class=\"wp-image-3879\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?resize=1024%2C186&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?resize=300%2C55&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?resize=768%2C140&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?resize=1536%2C279&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-15-at-08.02.01.png?w=1760&amp;ssl=1 1760w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The ability to search for specific text within PDF files using the Linux command line is a powerful and time-saving tool. With utilities like\u00a0<code>pdfgrep<\/code>,\u00a0<code>pdftotext<\/code>, and\u00a0<code>grep<\/code>, you can quickly find the information you need, even in large or multiple PDF files. By mastering these command-line tools, you can enhance your productivity and efficiency in the digital world.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will explain how to search text in a PDF file using Linux command-line options. One of Linux&#8217;s many advantages is its command-line interface (CLI), which allows users to complete difficult tasks using short, text-based commands. Linux Basics It&#8217;s essential to understand what a PDF file is<\/p>\n","protected":false},"author":8,"featured_media":3881,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[758,762,759,761,764,763,766,765,760],"class_list":["post-3875","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-linux-pdf-files","tag-linux-pdf-search","tag-pdf-files-grep","tag-pdf-files-linux-commands","tag-pdf-files-linux-terminal","tag-pdfgrep","tag-pdftotext","tag-search-text-pdf","tag-text-search-pdf"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-search-text-in-a-PDF-file-via-Command-Line.png?fit=360%2C240&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-10v","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1795,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/10-linux-basic-commands-every-user-should-know\/","url_meta":{"origin":3875,"position":0},"title":"10 Linux Basic Commands Every User Should Know","author":"Shreyash Sharma","date":"July 31, 2020","format":false,"excerpt":"Linux can be daunting to some, especially if you have seen people working only through the terminal. Trust me, its not as complicated as it seems neither is it that hard to learn. The only issue is manufacturers do not Linux with their systems. What is Linux? The entire family\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/07\/7rQQixjPnrQv.png?fit=640%2C363&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/07\/7rQQixjPnrQv.png?fit=640%2C363&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/07\/7rQQixjPnrQv.png?fit=640%2C363&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3225,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-find-the-largest-files-in-linux\/","url_meta":{"origin":3875,"position":1},"title":"How to find the largest files in Linux","author":"George B.","date":"April 12, 2023","format":false,"excerpt":"When you have a server with 1TB of disk space and your storage is 80% full, it is important to find out which files(largest files) are taking up the most space on your system. This can be done by identifying the biggest files on your system and deleting or moving\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-find-largest-files-linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-find-largest-files-linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-find-largest-files-linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":884,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/linux-security-running-commands-safely\/","url_meta":{"origin":3875,"position":2},"title":"Linux Security: Running commands safely","author":"Daniel Draga","date":"January 27, 2017","format":false,"excerpt":"Security is an important but complex topic. So I'll be doing a series of articles, focusing on the principles and working of security of Linux. The challenge is that it\u2019s an ever-changing idea. Software we think of as secure can become insecure as hackers figure out how to break though\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/9.png?fit=1200%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/9.png?fit=1200%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/9.png?fit=1200%2C750&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/9.png?fit=1200%2C750&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/9.png?fit=1200%2C750&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":240,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/15-most-basic-linux-commands\/","url_meta":{"origin":3875,"position":3},"title":"15 Most Basic Linux commands","author":"Daniel Draga","date":"July 30, 2016","format":false,"excerpt":"Linux is different, I know you already know that, and if are on this article you\u2019ve taken your first step into the amazin world of Linux OS (little exaggeration). Here I am going to provide a common command list most commonly used in Linux with their brief introduction. # 1:\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/unzip-cento.png?fit=505%2C250&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":881,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/linux-security-privacy-on-linuxencryption\/","url_meta":{"origin":3875,"position":4},"title":"Linux Security: Privacy on Linux(Encryption)","author":"Daniel Draga","date":"January 26, 2017","format":false,"excerpt":"Security is an important but complex topic. So I'll be doing a series of articles, focusing on the principles and working of security of Linux. The challenge is that it\u2019s an ever-changing idea. Software we think of as secure can become insecure as hackers figure out how to break though\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/linux-ransomware-wide.jpeg?fit=600%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/linux-ransomware-wide.jpeg?fit=600%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/linux-ransomware-wide.jpeg?fit=600%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2164,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/manage-linux-package-managers-with-the-shell\/","url_meta":{"origin":3875,"position":5},"title":"Manage Linux package managers with the shell","author":"Shreyash Sharma","date":"December 19, 2020","format":false,"excerpt":"Package management via the Advanced Package Tool, or APT for short, is part of the recipe for success of Debian and thus also of offshoots such as Ubuntu.\u00a0There are plenty of graphical interfaces for this, but APT can only take advantage of all its advantages in the shell. Installing and\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/12\/installing-linux-apps-package.png?fit=640%2C412&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/12\/installing-linux-apps-package.png?fit=640%2C412&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/12\/installing-linux-apps-package.png?fit=640%2C412&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3875"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3875\/revisions"}],"predecessor-version":[{"id":3884,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3875\/revisions\/3884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3881"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}