Last active
August 2, 2018 23:53
-
-
Save luochen1990/c34df194f0b8f252ec5932c3f9b74b47 to your computer and use it in GitHub Desktop.
the `dx` alias: a convenient wrapper of the `docker exec` command
This file contains hidden or 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
| docker_exec() { | |
| matches=$( docker ps | grep $1 ) | |
| echo "$matches" | |
| pid=$(echo $matches | awk "{print \$1}" ) | |
| echo Entering: $pid | |
| docker exec -it $pid sh | |
| } | |
| alias dx="docker_exec" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment