Grep: Search Many Files and Directories Recursively

This topic was published by and viewed 529 times since "". The last page revision was "".

Viewing 1 post (of 1 total)
  • Author
    Posts
  • DevynCJohnson
    DevynCJohnson
    Keymaster
    • Topics - 444
    • @devyncjohnson

    When using the "grep" command on a Unixoid system, there is a way to search many files from a top-level directory down. In other words, a user can search recursively for a file that contains a certain string. The below commands can each be used to perform a recursive search.

    • Case-insensitive - grep -r -i -e "STRING" ./*
    • Case-sensitive - grep -r -e "STRING" ./*
    • Case-insensitive (rarely used) - find . -type f -print | xargs grep -i -e "STRING" ./*
Viewing 1 post (of 1 total)