Categories
Technical Unix

Find string in Unix file

Find a specific string in unix files

grep -r "asdasdasdas" src/*

Find a specific string in unix file and return line number

grep -nr "\$files->setParentFileUUID" src/*

\ backslash in front of the dollar sign prevent conflicting interpretation while executing the command

find . -type f -name "*.*" -exec grep -il "YOUR TEXT" {} \;