标签:grep -v code int sed tmp lin txt dock pre
删掉不在运行的docker:
#!/bin/sh
if [ -f /tmp/docker.txt ]
then
rm -f /tmp/docker.txt
fi
docker ps -a |egrep -v Up|awk -F ‘[ ]+‘ ‘{print $1}‘|sed 1d >/tmp/docker.txt
while read line
do
docker rm $line
done </tmp/docker.txt
标签:grep -v code int sed tmp lin txt dock pre
原文地址:https://blog.51cto.com/11873474/2464035