Greppable KJV

Here’s the KJV Bible as an ASCII text file – one verse per line – suitable for use with text processing commands:
http://www.mcgill.org.za/stuff/wp-content/uploads/2017/02/kjv
DISCLAIMER: I have not checked that this is an accurate transcription of the Bible. I got the source file from which this is derived from a site that had dubious theology, and which offered a “improved” version. I noticed some differences in punctuation between this and the ‘eSword’ software. Additionally, since it is text, the italics originally provided by the 1611 translators and preserved with the spelling changes are not present.

Each verse is given in the following format on a single line:

  • Book name
  • Chapter : Verse
  • Text

Here’s a sample:

Genesis 1:1 In the beginning God created the heaven and the earth.
Genesis 1:2 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
Genesis 1:3 And God said, Let there be light: and there was light.
Genesis 1:4 And God saw the light, that it was good: and God divided the light from the darkness.

Here are some handy uses of this:

Read the Bible using less:

less kjv

Find a verse by reference:

grep "^John 3:16 " kjv 
John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.  

Get the most common words from the text of the book of John:

grep ^John kjv | cut -f 3-99 -d ' ' | tr A-Z a-z | egrep -o '[a-z]+' | sort | uniq -c | sort -rn | head -10
   1039 the
    921 and
    530 that
    474 of
    457 he
    423 i
    412 him
    377 unto
    297 not
    256 jesus

Find most common words in the book of John:

grep ^John kjv | cut -f 3-99 -d ' ' | tr A-Z a-z | egrep -o '[a-z]+' | sort | uniq -c | sort -rn | head -10
   1039 the
    921 and
    530 that
    474 of
    457 he
    423 i
    412 him
    377 unto
    297 not
    256 jesus

Find “workers of iniquity” in the whole Bible:

grep --colour 'workers of iniquity' kjv
Job 31:3 Is not destruction to the wicked? and a strange punishment to the workers of iniquity?  
Job 34:8 Which goeth in company with the workers of iniquity, and walketh with wicked men.  
Job 34:22 There is no darkness, nor shadow of death, where the workers of iniquity may hide themselves.  
Psalms 5:5 The foolish shall not stand in thy sight: thou hatest all workers of iniquity.  
Psalms 6:8 Depart from me, all ye workers of iniquity; for the LORD hath heard the voice of my weeping.  
Psalms 14:4 Have all the workers of iniquity no knowledge? who eat up my people as they eat bread, and call not upon the LORD.  
Psalms 28:3 Draw me not away with the wicked, and with the workers of iniquity, which speak peace to their neighbours, but mischief is in their hearts.  
Psalms 36:12 There are the workers of iniquity fallen: they are cast down, and shall not be able to rise.  
Psalms 37:1 Fret not thyself because of evildoers, neither be thou envious against the workers of iniquity.  
Psalms 53:4 Have the workers of iniquity no knowledge? who eat up my people as they eat bread: they have not called upon God.  
Psalms 59:2 Deliver me from the workers of iniquity, and save me from bloody men.  
Psalms 64:2 Hide me from the secret counsel of the wicked; from the insurrection of the workers of iniquity: 
Psalms 92:7 When the wicked spring as the grass, and when all the workers of iniquity do flourish; it is that they shall be destroyed for ever: 
Psalms 92:9 For, lo, thine enemies, O LORD, for, lo, thine enemies shall perish; all the workers of iniquity shall be scattered.  
Psalms 94:4 How long shall they utter and speak hard things? and all the workers of iniquity boast themselves?  
Psalms 94:16 Who will rise up for me against the evildoers? or who will stand up for me against the workers of iniquity?  
Psalms 125:5 As for such as turn aside unto their crooked ways, the LORD shall lead them forth with the workers of iniquity: but peace shall be upon Israel.  
Psalms 141:9 Keep me from the snares which they have laid for me, and the gins of the workers of iniquity.  
Proverbs 10:29 The way of the LORD is strength to the upright: but destruction shall be to the workers of iniquity.  
Proverbs 21:15 It is joy to the just to do judgment: but destruction shall be to the workers of iniquity.  
Luke 13:27 But he shall say, I tell you, I know you not whence ye are; depart from me, all ye workers of iniquity.  

Get the text of the book of John:

grep ^John kjv | cut -f 3-99 -d ' '

Get the number of verses per book in the Bible – using “sed” – because some of the book titles include a number:

sed 's/:.*//;s/[0-9]*$//' kjv | uniq -c | head
   1533 Genesis 
   1213 Exodus 
    859 Leviticus 
   1288 Numbers 
    959 Deuteronomy 
    658 Joshua 
    618 Judges 
     85 Ruth 
    810 1 Samuel 
    695 2 Samuel

Find the most common verbs in the Bible:

cat kjv | cut -f 3-99 -d ' ' | tr A-Z a-z | egrep -o '[a-z]+' | sort | uniq -c | sort -rn | grep eth$ | head
    282 cometh
    135 goeth
    126 maketh
    126 giveth
    104 knoweth
     96 liveth
     96 doeth
     79 bringeth
     74 taketh
     74 speaketh

Finding the longest words in the bible …

cat kjv | egrep -io '[a-z]{17,}' |sort | uniq -c | sort -rn | head
      4 Chushanrishathaim
      2 Mahershalalhashbaz

Build a list of the books in the bible …

sed < kjv 's/:.*//; s/ [^ ]*$//' | uniq > books

Build a file of regular expressions to grep for verses in text, and then extract all references from a long article:

sed < kjv 's/:.*//; s/ [^ ]*$//; s/$/ [0-9]*:[0-9]*/' | uniq > reference-regex
grep -w -o -f reference-regex < article

Here are the most popular verses quoted in support of "lordship salvation" - the ones that appear multiple times in an article -

grep -o -w -f reference-regex < article | sort |uniq -c | sort -n | tail -16 | tac
      4 Romans 6:16
      4 John 3:8
      3 James 4:4
      3 Hebrews 5:9
      3 Ephesians 5:3
      3 Ephesians 2:10
      2 Titus 2:12
      2 Titus 2:11
      2 Romans 8:7
      2 Romans 5:21
      2 Matthew 7:16
      2 Acts 26:20
      2 2 John 1:9
      2 2 John 1:6
      2 1 John 2:3
      1 Titus 2:14

And here are the top 6 - the "1 John 3:8" is a verse that is frequently referenced, but because of not using "^" and "$" in the regular expressions, the even more interesting "John 3:8" is found:

grep -o -w -f reference-regex < article  | sort | uniq -c | sort -n | tail -5 | sed 's/^ *[0-9]* //' > popular; grep -w -f popular ~/kjv 
John 3:8 The wind bloweth where it listeth, and thou hearest the sound thereof, but canst not tell whence it cometh, and whither it goeth: so is every one that is born of the Spirit.  
Romans 6:16 Know ye not, that to whom ye yield yourselves servants to obey, his servants ye are to whom ye obey; whether of sin unto death, or of obedience unto righteousness?  
Ephesians 5:3 But fornication, and all uncleanness, or covetousness, let it not be once named among you, as becometh saints; 
Hebrews 5:9 And being made perfect, he became the author of eternal salvation unto all them that obey him; 
James 4:4 Ye adulterers and adulteresses, know ye not that the friendship of the world is enmity with God? whosoever therefore will be a friend of the world is the enemy of God.  
1 John 3:8 He that committeth sin is of the devil; for the devil sinneth from the beginning. For this purpose the Son of God was manifested, that he might destroy the works of the devil.