Skip to content

Instantly share code, notes, and snippets.

@gotofritz
Last active November 13, 2016 17:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotofritz/5232223 to your computer and use it in GitHub Desktop.
Save gotofritz/5232223 to your computer and use it in GitHub Desktop.
various bash find command
#sort files by number of lines
find /path/to/folder -name '*.js' | xargs wc -l | sort
#find files inside archive
find /dir/ -iname archive.tar -print0 | xargs -0 tar t -f | grep "filename you are searching for"
find /dir/ -iname archive.zip -print0 | xargs -0 unzip -l | grep "filename you are searching for"
find /dir/ -iname archive.rar -print0 | xargs -0 unrar l | grep "filename you are searching for"
#list files that were changed in the last day, sorted by size
sudo find / -type f -mtime -1 -print0 | xargs -0 du -sk | sort -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment