1 2 3 4 5 6 7 8
pat=$1 docker_ids=`docker ps -a | grep ${pat} | awk '{print $1}'` for X in ${docker_ids} do docker rm -f ${X} done