pdf search command line

PDF search command line

Rate this article

Share this article
Share on facebook
Share on twitter
Share on linkedin
Share on email

In this article we will see how to create a PDF search using the command line.

Here we will take the following PDF and see if we can make extract its content searchable. PDF link here 

PDF search command line

Here are the steps-

  1. Open a terminal in linux.
  2. Use the wget function to get download the file and save it to dc-best-practices-google.pdf.
    wget "https://static.googleusercontent.com/media/www.google.com/en//corporate/datacenter/dc-best-practices-google.pdf"
    

     

  3. Use pdftotext function to convert the file to text.
    pdftotext dc-best-practices-google.pdf 
    

     

  4. open the file dc-best-practices-google.txt with any editor
    vim dc-best-practices-google.txt

     

  5. Use the grep command to search for Green data center
    grep -F -C2 "Green Data Center" dc-best-practices-google.txt

     

  6. This will show the following output which confirms that the PDF data has been made searchable.pdf search command line
  7. To create your PDF search engine, use this link PDF search command line

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.

You may also like
Hold on!
We’ve gathered our industry knowledge and are sharing hacks, tips to increase e-commerce revenue. Contains best tips for scaling up your ecommerce business.