Skip to content

Instantly share code, notes, and snippets.

@gmillerd
Last active February 13, 2017 19:38
Show Gist options
  • Select an option

  • Save gmillerd/ba3df20849d224a530f1174eb81d9f50 to your computer and use it in GitHub Desktop.

Select an option

Save gmillerd/ba3df20849d224a530f1174eb81d9f50 to your computer and use it in GitHub Desktop.
fancy find for efficiently traversing very populated directories for recent data.
#!/bin/bash
find /logs/ -maxdepth 1 -mindepth 1 -type d -print0 | \
xargs -0 -r -P4 -n1 -I% find % -maxdepth 1 -mindepth 1 -type d -print0 | \
xargs -0 -r -P4 -n1 -I% find % -maxdepth 1 -mindepth 1 -type f -name "celog_event.xml" -print0
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment