Skip to content

Instantly share code, notes, and snippets.

@noxdafox

noxdafox/tricks.sh

Last active Oct 16, 2019
Embed
What would you like to do?
Collection of bash tricks
# Average file size in folder
# Credits: http://www.bradlanders.com/2011/04/27/bash-one-liner-average-file-size-in-current-directory/
ls -l | awk '{s+=$5} END {print "Average file size: " s/NR/1024 "k"}'
# Clear Docker related data
docker kill $(docker ps -q) # Kill running containers
docker rm $(docker ps -a -q) # Remove existing containers
docker rmi $(docker images -q) # Remove images
docker rmi $(docker images -q -f dangling=true) # Remove untagged images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.