Skip to content

Instantly share code, notes, and snippets.

@RobbiNespu
Created December 26, 2022 14:01
Show Gist options
  • Save RobbiNespu/aa81b691956d4283912e65762a69e094 to your computer and use it in GitHub Desktop.
Save RobbiNespu/aa81b691956d4283912e65762a69e094 to your computer and use it in GitHub Desktop.
Posix - Speed up "find" + "exec" command (recursive)
# let see how many files we have
$ find . -type f | wc -l
36367
# lets check every file status
$ time find . -type f -exec stat {} \; > /dev/null
real 0m40.107s
user 0m14.381s
sys 0m26.410s
# lets check every file status
$ time find . -type f -exec stat {} + > /dev/null
real 0m1.281s
user 0m0.626s
sys 0m0.656s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment