Skip to main content
3 of 3
small correction that works
Kevdog777
  • 3.3k
  • 18
  • 45
  • 66

Presumably the file .bash_history starts with non-text data, hence grep is treating the file as binary. This is confirmed by the file .bash_history output:

.bash_history: data 

You can read a few bytes from start to have a conforming view:

head -c1K .bash_history 

Here I am reading first 1 KiB.

You can pipe the STDOUT to hexdump/od or similar.


As a side note, grep takes filename(s) as argument, so cat is useless here; try this:

grep git .bash_history
heemayl
  • 58.1k
  • 9
  • 129
  • 144