|
|
|
|
|
by barrkel
651 days ago
|
|
If you have a lot of files, consider find piped to xargs with -P for parallelism and -n to limit the number of files per parallel invocation. Only a tiny bit more complex but often an order of magnitude faster with today's CPUs. Use -print0 on find with -0 on xargs to handle spaces in filenames correctly. GNU parallel is another step up, but xargs is generally always to hand. |
|
find [...] - exec [...] {} +
as opposed to
find [...] - exec [...] {} \;
worked fine and was performant enough for my use-case. An example command was
find . -type f -name "*.html" -exec sed -i '' -e 's/\.\.\/\.\.\/\.\.\//\.\.\/\.\.\/\.\.\/source\//g' {} +
which took about 20s to run