Skip to content

Instantly share code, notes, and snippets.

@sphrak
Last active February 15, 2022 11:21
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 sphrak/459d0f0350bd585430f22c2c0800389a to your computer and use it in GitHub Desktop.
Save sphrak/459d0f0350bd585430f22c2c0800389a to your computer and use it in GitHub Desktop.
List of useful unix commands

Useful unix commands

recursively search files matching *.fileExt for pattern in current directory

grep --color -inr --include \*.kt 'SDK_INT' .

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