From 16ee3022b097226b3110e0a1ed1d3a43a318ace4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Le=C3=B1ero?= Date: Wed, 25 Oct 2017 15:41:07 -0500 Subject: [PATCH 1/6] pdfgrep: add page --- pages/linux/pdfgrep.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pages/linux/pdfgrep.md diff --git a/pages/linux/pdfgrep.md b/pages/linux/pdfgrep.md new file mode 100644 index 0000000000..f65a705844 --- /dev/null +++ b/pages/linux/pdfgrep.md @@ -0,0 +1,19 @@ +# pdfgrep + +> Search text in PDF files. + +- Find lines that match pattern in a PDF: + +`pdfgrep {{pattern}} {{file.pdf}}` + +- Include file name and page number for each matched line: + +`pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}` + +- Find the first 3 lines that begin with foo case insensitive: + +`pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` + +- Find pattern in pdf files under the current directory recusively: + +`pdfgrep --recursive --include {{'*.pdf'}} {{pattern}}` From b51dab155dcab5f3d83cc4016989bfd96e244855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Le=C3=B1ero?= Date: Wed, 25 Oct 2017 18:34:41 -0500 Subject: [PATCH 2/6] Clarify recursive functionality. --- pages/linux/pdfgrep.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/linux/pdfgrep.md b/pages/linux/pdfgrep.md index f65a705844..2a9bda0533 100644 --- a/pages/linux/pdfgrep.md +++ b/pages/linux/pdfgrep.md @@ -14,6 +14,10 @@ `pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` -- Find pattern in pdf files under the current directory recusively: +- Find pattern in files with a .pdf extension in the current directory recusively: -`pdfgrep --recursive --include {{'*.pdf'}} {{pattern}}` +`pdfgrep --recursive {{pattern}}` + +- Find pattern recursively on files that match a specific glob: + +`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}'` From 512bd35b617436324f0cec92a1b5c5bceb038f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Le=C3=B1ero?= Date: Wed, 25 Oct 2017 18:35:50 -0500 Subject: [PATCH 3/6] Remove extra quote character. --- pages/linux/pdfgrep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/linux/pdfgrep.md b/pages/linux/pdfgrep.md index 2a9bda0533..b1a24817d2 100644 --- a/pages/linux/pdfgrep.md +++ b/pages/linux/pdfgrep.md @@ -20,4 +20,4 @@ - Find pattern recursively on files that match a specific glob: -`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}'` +`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}` From da10a8fa0d81190031e0395d0087ef9ed4b41474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Le=C3=B1ero?= Date: Wed, 1 Nov 2017 17:27:26 -0500 Subject: [PATCH 4/6] Update pdfgrep.md --- pages/linux/pdfgrep.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/linux/pdfgrep.md b/pages/linux/pdfgrep.md index b1a24817d2..a29d8ef161 100644 --- a/pages/linux/pdfgrep.md +++ b/pages/linux/pdfgrep.md @@ -10,14 +10,14 @@ `pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}` -- Find the first 3 lines that begin with foo case insensitive: +- Do a case insensitive search for lines that begin with "foo" and return the first 3 matches. `pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` -- Find pattern in files with a .pdf extension in the current directory recusively: +- Find pattern in files with a .pdf extension in the current directory recursively: `pdfgrep --recursive {{pattern}}` -- Find pattern recursively on files that match a specific glob: +- Find pattern on files that match a specific glob in the current directory recursively: `pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}` From 403bd1720a35eff617c7598bc494f38fdec48916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Le=C3=B1ero?= Date: Wed, 1 Nov 2017 17:29:10 -0500 Subject: [PATCH 5/6] Use colon for consistency. --- pages/linux/pdfgrep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/linux/pdfgrep.md b/pages/linux/pdfgrep.md index a29d8ef161..5e229a05b4 100644 --- a/pages/linux/pdfgrep.md +++ b/pages/linux/pdfgrep.md @@ -10,7 +10,7 @@ `pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}` -- Do a case insensitive search for lines that begin with "foo" and return the first 3 matches. +- Do a case insensitive search for lines that begin with "foo" and return the first 3 matches: `pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` From a50e72570f926337a9ffb711f1cabe290fede37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Le=C3=B1ero?= Date: Wed, 1 Nov 2017 17:32:52 -0500 Subject: [PATCH 6/6] Add pdfgrep.md to osx folder. --- pages/osx/pdfgrep.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/osx/pdfgrep.md diff --git a/pages/osx/pdfgrep.md b/pages/osx/pdfgrep.md new file mode 100644 index 0000000000..5e229a05b4 --- /dev/null +++ b/pages/osx/pdfgrep.md @@ -0,0 +1,23 @@ +# pdfgrep + +> Search text in PDF files. + +- Find lines that match pattern in a PDF: + +`pdfgrep {{pattern}} {{file.pdf}}` + +- Include file name and page number for each matched line: + +`pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}` + +- Do a case insensitive search for lines that begin with "foo" and return the first 3 matches: + +`pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` + +- Find pattern in files with a .pdf extension in the current directory recursively: + +`pdfgrep --recursive {{pattern}}` + +- Find pattern on files that match a specific glob in the current directory recursively: + +`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}`