Skip to content

Instantly share code, notes, and snippets.

@vadimkantorov
Last active January 1, 2024 10:40
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 vadimkantorov/b1ec5127235f2bb3603a8429f6b9b257 to your computer and use it in GitHub Desktop.
Save vadimkantorov/b1ec5127235f2bb3603a8429f6b9b257 to your computer and use it in GitHub Desktop.
Various find tricks
# cat all files not in .git directory
find -not -iwholename '*.git*' -type f -exec cat {} +
# cat all tsx files not in .git directory with file name section header
find -not -iwholename '*.git*' -type f -name '*.tsx' -exec tail --lines=+1 {} +
# unpack several downloaded tar files and then delete the original archives
find -name '*.tar.gz' -type f -exec tar -xf {} \; -delete
# search recursively in all CMakeLists.txt files a substring 1.78
find . -name CMakeLists.txt -exec grep -H '1.78' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment