Created
January 6, 2021 07:28
-
-
Save jnaskali/75569c89a3e5770ba21c0a4e5ef7044f to your computer and use it in GitHub Desktop.
One-liner that prints currently running docker containers (to the first - or _, so 'service-web' & 'service-db' only show up as 'service').
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
type docker &>/dev/null && echo -n "Running containers: " && docker ps --format "{{.Names}}" | grep -o "^[^-_]*" | sort -u | tr '\n' ' ' && echo | |
# EXAMPLE OUTPUT: | |
# Running containers: caddy mealie n8n nodebb seafile shadowsocks shiori |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment