管道命令简直是神器,一句话搞定~
for cid in docker ps -a | awk '{print $1}'| sed -n '2,$p'
;do docker rm $cid;done
其中:
awk ‘{print $1}’ 获取了对应的列(编号从1开始)
sed -n ‘2,$p’ 排除了标题行
爽歪歪 ~
We read the world wrong and say that it deceives us.
管道命令简直是神器,一句话搞定~
for cid in docker ps -a | awk '{print $1}'| sed -n '2,$p'
;do docker rm $cid;done
其中:
awk ‘{print $1}’ 获取了对应的列(编号从1开始)
sed -n ‘2,$p’ 排除了标题行
爽歪歪 ~