I'm greping through a large codebase, and leading whitespaces and tabulation seem to be quite annoying. Is there any way to get rid of it?
grep -R "something" ./
E.g, instead of:
foo/bar.cpp: qwertyuiosomethingoi
foo/bar/baz.h: 43rfsgsomethingdrfg
bar/bar.cpp: 1234edwssomethingczd
I want to get something like:
foo/bar.cpp: qwertyuiosomethingoi
foo/bar/baz.h: 43rfsgdsomethingrfg
bar/bar.cpp: 1234edwssomethingczd
Or better:
foo/bar.cpp: qwertyuisomethingooi
foo/bar/baz.h: 43rfsgdrsomethingfg
bar/bar.cpp: 1234edwssomethingczd
Best Answer
Create test files
produce full glorious colour :)
output (run it to get the colour).
Tested in
gnome-terminal
,konsole
,terminator
,xterm