How to run sed on over 10 million files in a directory?
- by Sandro
I have a directory that has 10144911 files in it. So far I've tried the following:
for f in ls; do sed -i -e 's/blah/blee/g' $f; done
Crashed my shell, the ls is in a tilda but i can't figure out how to make one.
ls | xargs -0 sed -i -e 's/blah/blee/g'
Too many args for sed
find . -name "*.txt" -exec sed -i -e 's/blah/blee/g' {} \;
Couldn't fork any more no more memory
Any other ideas on how to create this kind command? The files don't need to communicate with each other. ls | wc -l seems to work (very slow) so it must be possible.