Skip to content

Instantly share code, notes, and snippets.

@lucaswhitman
Last active October 9, 2017 18:02
Show Gist options
  • Save lucaswhitman/916d0da397ed39d9d69f208188123f61 to your computer and use it in GitHub Desktop.
Save lucaswhitman/916d0da397ed39d9d69f208188123f61 to your computer and use it in GitHub Desktop.
Handy shell commands
#find 20 largest files of certain extension recursively
find . -type f -name '*_test.js' -print0 | xargs -0 du | sort -n | tail -20 | cut -f2 | xargs -I{} du -sh {}
# find all git logs since date and export csv
git log --after='2017-04-01' --pretty=format:'%h;%an;%ad;%s' > ~/Desktop/logs.csv
# delete files older than x days:
find /path/to/directory/ -mindepth 1 -mtime +5 -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment