Last active
November 7, 2017 17:42
-
-
Save BernCarney/c7bd2c49c7773f5a0f5d3d5334eb7e96 to your computer and use it in GitHub Desktop.
Useful Aliases and Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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