Need help in word count command
I have a file(text.txt) and it something like this:
Book and Book book
I don't know
what to write here Book
I need to know what
Ok, when do word count it should say the word 'book' appear 5 times. I try this command but no luck...!!
grep -i book text.txt |wc -w <--- result 10
cat text.txt | grep -i book |wc -w <--- result 10
cat text.txt | grep -i book |wc -l <--- result 3
grep -c book text.txt <--- result 1
Anyone can help?