Skip to content

Instantly share code, notes, and snippets.

@wangyung
Last active April 19, 2022 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wangyung/8e9efc496b7a145601943d0814d7109a to your computer and use it in GitHub Desktop.
Save wangyung/8e9efc496b7a145601943d0814d7109a to your computer and use it in GitHub Desktop.
The tips of using find command

Find jpg files and calculate the total size

  • find [Folder] -name "*.jpg" -exec du -ch {} +

Find png files and excludes some folders

  • find [Folder] -name "*.png" | grep -v build (Slow)

Find png files and run commands (convert to webp)

  • find [Folder] -name "*.png" | xargs -I {} cwebp -lossless {} -o {}.webp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment