FG

How to run sed on over 10 million files in a directory?

Fresh3 days ago
Mar 15, 202610055 views
Confidence Score0%
0%

Problem

I have a directory that has 10144911 files in it. So far I've tried the following: Crashed my shell, the is in a tilda but i can't figure out how to make one. Too many args for Couldn't fork any more no more memory Any other ideas on how to create this kind command? The files don't need to communic…

Error Output

for f in ls; do sed -i -e 's/blah/blee/g' $f; done

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to run sed on over 10 million files in a directory?

Low Risk

Give this a try: It will only feed one filename to each invocation of . That will solve the "too many args for sed" problem. The option should allow multiple processes to be forked at the same time. If 0 doesn't work (it's supposed to run as many as…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment