sort + awk 排序後取第一條

docker images排除latest,tag排序,輸出每一個鏡像第一(或最後)一條python


root@master:~#  docker images | grep -v REPOSITORY | sort -t $'\t' -r -k 2 | awk 'BEGIN{n=""}n!=$1 && !/latest/{n=$1;print $1":"$2}'
ubuntu:18.04
python:3-alpine
mongo:4.2.1-bionic
maven:3
mariadb:10
i386/alpine:3.10.3
golang:alpine3.7
bitnami/redis:4.0.8-r2
bitnami/kafka:2.3.1-debian-9-r21
bestwu/qq:office
alpine:3.7
相關文章
相關標籤/搜索