SHELL

shell script

push docker images to ali registry-mirrors https://cr.console.aliyun.com #!/usr/bin/env bash docker login --username=wubigo registry.cn-beijing.aliyuncs.com docker images | grep v1.13 | awk '{ print $1 }' | sed --expression=s'/K8S.gcr.io\///' | xargs -i -t docker tag K8S.gcr.io/{}:v1.13.3 registry.cn-beijing.aliyuncs.com/co1/{}:v1.13.3 docker images |grep "registry.cn-beijing.aliyuncs.com"| awk '{ print $1 }'| sed --expression=s'/registry.cn-beijing.aliyuncs.com\/co1\///' | xargs -i -t docker push registry.cn-beijing.aliyuncs.com/co1/{}:v1.13.3 docker push through cache #!/usr/bin/env bash if [ -z "$VM" ]; then VM = t1 echo "VAR VM is not set" exit fi tee daemon.

应该掌握的linux命令

LINUX shell常用工具提供强大的功能,在日常中熟练掌握能给我 带来不少动能 grep cat find head/tail wc awk shuf 查找 在logs目录下查找所有包含2010_05_02的日志文件 ls logs/ | grep 2010_05_02 pip freeze | grep scipy scipy==1.1.0 grep -oP "'[\w]+ == [\d.]+'" setup.py scipy == 1.1.0 # find . -name '..*swp' -delete awk head -n 1 data.csv | awk -F ',' '{print NF}' shuf 从数据集中随机取50个样本 cat big_csv.csv | shuf | head -n 50 > sample_csv.csv