Created
January 3, 2018 05:00
-
-
Save vigack/6c5ec8e7ec24072b0d1574812177ebf3 to your computer and use it in GitHub Desktop.
一行代码关闭所有运行中的docker容器
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
docker ps|awk '{if (NR!=1) print $1}'| xargs docker stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
主要运用了awk和xargs,同样的原理可用于删除容器、镜像等