find files and seach limit with grep

view full story

http://www.unix.com – Hi, I'm testing nginx-cache-purge and notice that grep searches all file content, and since the cache key is in the second line I would like to limit grep searching. This is the script I'm using: github.com/perusio/nginx-cache-purge The line I would like to change and limit grep search to the Second line is: Code: find $2 - maxdepth 1 - type d | xargs - P $max_ pa ralle l - n 1 gre p - Rl " $1" | so rt - u Seaching in google I found out that the command head -n can help me with this, but I can't get it to work. Can someone help me with this? Thanks (HowTos)