Skip to content

Instantly share code, notes, and snippets.

@BernCarney
Last active November 7, 2017 17:42
Show Gist options
  • Save BernCarney/c7bd2c49c7773f5a0f5d3d5334eb7e96 to your computer and use it in GitHub Desktop.
Save BernCarney/c7bd2c49c7773f5a0f5d3d5334eb7e96 to your computer and use it in GitHub Desktop.
Useful Aliases and Functions
# Named Directories
hash -d proj=/mnt/d/DevProjects/
# Aliases
alias -g gp=' | grep -i'
# Show all alias related docker
dalias() { alias | grep 'docker' | sed "s/^\([^=]*\)=\(.*\)/\1 => \2/"| sed "s/['|\']//g" | sort; }
# Bash into running container
dshell() { docker exec -it $(docker ps -aqf "name=$1") sh; }
# Stop and Remove all containers
alias drmf='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Clean up un-tagged docker images
alias drmi='docker rmi $(docker images -q --filter "dangling=true")'
# Dockerfile build
dbu() { docker build -t=$1 .; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment