Why does this bash command take up all space on device?

Posted by chelmertz on Stack Overflow See other posts from Stack Overflow or by chelmertz
Published on 2010-03-09T10:48:02Z Indexed on 2010/03/09 10:51 UTC
Read the original article Hit count: 213

Filed under:
|
|
|
|

Hey!

I'm a little new on searching via bash, so feel free to give me suggestions on the methods to use instead of this, which I'll never use again :)

I'm searching for occurances of a string, recursively in a directory, with ~50 not-that-large php-files in it; some in current directory, some in directories beneath current dir, three levels of directories down at most.

The method I'm using is:
find . | xargs grep "module" > module.txt

When in simple (one level) directories, this works fine, but in this case, the file became 4 GB large until it filled up all space on the partition :) It wasn't even done yet..

Would someone educate me so I won't embarass myself again?

© Stack Overflow or respective owner

Related posts about bash

Related posts about file