Skip to content

Instantly share code, notes, and snippets.



Last active Oct 5, 2020
What would you like to do?
List of useful linux commands

Useful linux commands

Detect how many gradle daemons are running

Get the current amount of instances - 1

ps aux | grep GradleDaemon | wc -l

perform operation on specific files in directories

find */*.tar -exec tar xvzf {} \;

Total file size of certain filetype

find . -type f -name '*.png' -exec du -ch {} + | grep total$

Delete all build/ directories and its contents recursively

find . -name 'build' -type d -exec rm -rf {} \;

Search files for specific reference

grep -rnw . --exclude-dir={build,*.iml} -e 'pattern'

Delete files in current directory older than 7 days

find . -name "*.sql" -type f -mtime +7 -exec rm -f {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment