examples of functions using grep (Global REgular exPression - g re p)

examples of functions using grep (Global Regular Expression) to show only ONE line of a file that matches the search.

This is a listing of functions ONLY as an example.
THIS WILL NOT WORK ON YOUR SYSTEM as these TEXT files are not on your system.

The plain text files in this directory may be copied to your local drive, create a "BIBLES" directory and place them there.

Additional plain text files may be found at:
    http://johnmeister.com/BIBLE/BIBLES-for-text-searches/


Modify the path to the text files you have.
READ the man pages for grep to see what the options do, or simply experiment with the command to see what is shown.


CREATE an alias in your .bashrc file to see the functions you have created:

    alias list-functions="grep function ~/.bashrc"


The example below only looks complicated, and most of these functions I rarely use, I leave them in my .bashrc file as examples. Also, you can "pipe" ( | ) the results through another filter, and grep for additional key words that might appear on the matching string. The last two functions provide an example where an additional grep only listed passages that were NASB or NKJV, both of which are copyrighted so I can not add those files to this site. However, if you have Bible software with a licensed copy then you could create your own text file for searching. The KJV file included in this directory is public domain, as are the foreign language versions.

the alias to see the functions in your .bashrc is executed by typing: list-functions --> list-functions alias list-functions="grep function ~/.bashrc" function dir-mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; } # functions - ############################################################################### # function gz () { grep -B 2 -A 2 -i "$*" ~/BIBLES/GRK-NAS.txt;} ## NAS,LXX-GR-NA function gz () { grep -C 2 -i "$*" ~/BIBLES/GRK-NAS.txt;} ## NAS,LXX-GR-NA function gv () { grep -A 3 -B 2 -i "$*" ~/BIBLES/OTHER/NAS-VN.txt;} ## NAS-VN function gvk () { grep -A 4 -B 2 -i "$*" ~/BIBLES/OTHER/NAS-VN-NKJV.txt;} ## NAS-VN-NKJV function ga () { grep -A 4 -B 2 -i "$*" ~/BIBLES/AKDG.txt;} ## NAS,NKJV,DHS,GR-NA,GR-TR function gzp () { grep -A 6 -B 4 -i "$*" ~/BIBLES/AKDG.txt;} ## NAS,NKJV,DHS,GR-NA,GR-TR function gn () { grep -i "$*" ~/BIBLES/NAS.txt;} ## gn NAS - New American Std function gk () { grep -i "$*" ~/BIBLES/KJV.txt;} ## gk KJV - KJV function gw () { grep -i "$*" ~/BIBLES/NKJV.txt;} ## gw NKJV - New KJV function gnf () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 80;} ## NAS 80 columns function gnf100 () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 100;} ## NAS 100 columns function gnf120 () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 120;} ## NAS 120 columns function gn2 () { grep -C 2 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 2 lines function gn3 () { grep -C 3 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 3 lines function gn4 () { grep -C 4 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 4 lines function gn5 () { grep -C 5 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 5 lines function gn6 () { grep -C 6 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 6 lines function gzak () { grep -A 4 -B 2 -i "$*" ~/BIBLES/OTHER/NkKDG.txt;} ## gz NAS,NKJV,KJV,DHS,Greek function gey () { grep -A 3 -B1 -i "$*" ~/BIBLES/OTHER/SIX.txt;} ## NAS,NKJV,KJV,YLT,DHS,Greek function gak () { grep -A 3 -B 1 -i "$*" ~/BIBLES/OTHER/NKDG.txt;} ## KJV,NAS,DHS,Greek function gkn () { grep -C 1 -i "$*" ~/BIBLES/OTHER/KNb.txt;} ## KJV-NAS function gnd3 () { grep -A 5 -B 4 -i "$*" ~/BIBLES/OTHER/ND.txt;} ## NAS and DHS context 3 function gz-nas-uncited () { grep -A 4 -B 2 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek function gk3 () { grep -C 3 -i "$*" ~/BIBLES/KJV.txt;} ## KJV context 3 lines function gknd () { grep -C 3 -i "$*" ~/BIBLES/OTHER/KND.txt;} ## KJV,NAS,DHS context 3 function gknn () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/KNN.txt;} ## KJV,NKJV,NAS function gankdg () { grep -A 8 -B 3 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek function gankdgl () { grep -A 4 -B 3 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek function gnl () { grep -C 1 -i "$*" ~/BIBLES/OTHER/NNn.txt;} ## NAS-NKJV - no lines function gank () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/ANK.txt;} ## NAS,NKJV,KJV function g3 () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/NNK.txt;} ## NAS,NKJV,KJV function g4 () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/NkKD.txt;} ## NAS,NKJV,KJV,DHS function g5 () { grep -A 1 -B1 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS-not-cited,NKJV,KJV,DHS,Greek function g5c () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/NkKDG.txt;} ## NAS-cited,NKJV,KJV,DHS,Greek function gef () { grep -i "$*" ~/BIBLES/OTHER/ENG.txt |fold -s -w 80;} ## NAS-NKJV-KJV - folded function ge4 () { grep -i "$*" ~/BIBLES/OTHER/ENG4.txt;} ## NAS-NKJV-KJV-YLT function gy () { grep -i "$*" ~/BIBLES/OTHER/YLT.txt;} ## YLT - Youngs Literal function gnNT () { grep -i "$*" ~/BIBLES/OTHER/NT/NT-NAS.txt;} ## NT-NAS - New American Std function gnOT () { grep -i "$*" ~/BIBLES/OTHER/OT/OT-NAS.txt;} ## OT-NAS - New American Std function ge () { grep -i "$*" ~/BIBLES/OTHER/ENG.txt;} ## ge NAS-NKJV-KJV function g17 () { grep -A 16 -i "$*" ~/BIBLES/OTHER/R17.txt;} ## g17 versions function g24 () { grep -A 26 -B 2 -i "$*" ~/BIBLES/OTHER/24-versions.txt;} ## all 26 versions function g27 () { grep -A 27 -B 2 -i "$*" ~/BIBLES/OTHER/27-versions.txt;} ## all 27 versions function gt () { grep -B 1 -A 5 -i "$*" ~/BIBLES/OTHER/GETTR5.txt;} ## gt gettr CN,F,E,RUS function gnd () { grep -A 1 -i "$*" ~/BIBLES/OTHER/ND.txt;} ## gnd NAS and German function gnn () { grep -C 1 -i "$*" ~/BIBLES/OTHER/NN.txt;} ## gnn NAS-NKJV - lines function edg () { grep -A 2 -B1 -i "$*" ~/BIBLES/OTHER/EDG.txt;} ## NAS,GREEK,GERMAN function edgn () { grep -A 3 -B4 -i "$*" ~/BIBLES/OTHER/EDGN.txt;} ## NAS,GREEK,GERMAN,NKJV function edgn-nas () { grep -A 3 -B 1 -i "$*" ~/BIBLES/OTHER/EDGN.txt| grep -A 3 -B 1 "(nas)";} ## NAS,GREEK,GERMAN,NKJV function edgn-nk () { grep -A 3 -B 1 -i "$*" ~/BIBLES/OTHER/EDGN.txt| grep -B 5 "(nkjv)";} ## NAS,GREEK,GERMAN,NKJV

JohnMeister.com Today's Date:




fotomeister:john's favorite fotos


@meistertech youtube channel


Study the Bible on line

Bible Basics: an 8 section guide to understanding the Bible
on line here: HTML version Or view in PDF format.
Available at e-book retailers around the world in multiple formats.
Study Guide:(out of print-2023) The Art of LINUX Sys Admin
john's O'Reilly author info
e-books by john
published e-books by john:
Bible Basics  Full Size Jeep Buyer's Guide Simply Linux: Basics Linux Tackles Microsoft
Mac and Jack - the tail of two kitties Using BASH on Windows 10 Using BASH on Windows 10 - LITE VERSION
Practical Suggestions for Microsoft Windows

Linux Overview
-- bashrc and basics
The vi editor -- Linux notes
Scripting -- Filesystems
OS performance info -- Sys Admin

STUDY the Bible    ...in ONE year
...in Chronological Order
Parallel Bible for Study
Israel National News -- BBC: MidEast
Der Spiegel -- Voice of the Martyrs
News Links -- Jihadwatch.org

these links updated: 2023-01-02
overview of mankind's history
"Promises and Prophets"

Study the Bible.
Study the Bible with English, German and Greek.
verse by verse teachings on MP3
Details of the Passover week

THURSDAY on the cross...

BibleTech: multiple languages in parallel
FULL SIZE JEEP

Buyer's Guide


SJ Jeeps

"Jeep is America's
only real sports car."
-Enzo Ferrari

Mercedes, VW, and other Diesels
Nikon cameras -- and other general tech info

Bibletech.net
NW pollen count
Seattle traffic
Bridge Christian Fellowship mp3 teachings
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983

purchase AMSOIL and have it installed locally in Western Washington at the following locations, CALL ahead to have your specific AMSOIL products made available at:

- Northland Diesel 360.676.1970 - Bellingham, WA
- Fleet Services 425-355-4440 -Everett, WA
- and Dalton's 360-386-8571 - Marysville, WA

Or follow the link above/call the toll free number, and have delivered directly.
Please use Customer Number 283461, thank you.



SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)