I do more & more Linux work from the shell, and it's starting to grow on me. ;)
I used to search through files using this command
find . | xargs grep -s 'keyword'
but now & again get errors like xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
So I found this command works instead
find . -printf '"%p"\n' | xargs grep -s 'keyword'
or you can make a handy shell script (e.g. search.sh) like this
#!/bin/bash find . -printf '"%p"\n' | xargs grep -s "$1"
and then search files like
search.sh 'keyword'
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Ben Strackany
E-mail