#!/bin/bash ######################################################################### # File Name: dockerfile.sh # Author: www.linuxea.com # Version: 1 # Created Time: Thu 14 Feb 2019 10:52:01 AM CST ######################################################################### case"$OSTYPE"in linux*) docker history --no-trunc --format "{{.CreatedBy}}"$1 | # extract information from layers tac | # reverse the file sed 's,^\(|3.*\)\?/bin/\(ba\)\?sh -c,RUN,' | # change /bin/(ba)?sh calls to RUN sed 's,^RUN #(nop) *,,' | # remove RUN #(nop) calls for ENV,LABEL... sed 's, *&& *, \\\n \&\& ,g'# pretty print multi command lines following Docker best practices ;; darwin*) docker history --no-trunc --format "{{.CreatedBy}}"$1 | # extract information from layers tail -r | # reverse the file sed -E 's,^(\|3.*)?/bin/(ba)?sh -c,RUN,' | # change /bin/(ba)?sh calls to RUN sed 's,^RUN #(nop) *,,' | # remove RUN #(nop) calls for ENV,LABEL... sed $'s, *&& *, \\\ \\\n \&\& ,g'# pretty print multi command lines following Docker best practices ;; *) echo"unknown OSTYPE: $OSTYPE" ;; esac
可以在环境变量CDPATH中加入你常用的工作目录,当 cd 命令在当前目 录中找不到你指定的文件/目录时,会自动到 CDPATH 中的目录中寻找。
比如说我常去 /var/log 目录找日志,可以执行如下命令:
1 2 3 4 5 6 7 8 9
$ export CDPATH='~:/var/log' # cd 命令将会在 〜 目录和 /var/log 目录扩展搜索$ pwd /home/labuladong/musics $ cd mysql cd /var/log/mysql $ pwd /var/log/mysql $ cd my_pictures cd /home/labuladong/my_pictures
可以在环境变量CDPATH中加入你常用的工作目录,当 cd 命令在当前目 录中找不到你指定的文件/目录时,会自动到 CDPATH 中的目录中寻找。
比如说我常去 /var/log 目录找日志,可以执行如下命令:
1 2 3 4 5 6 7 8 9
$ export CDPATH='~:/var/log' # cd 命令将会在 〜 目录和 /var/log 目录扩展搜索$ pwd /home/labuladong/musics $ cd mysql cd /var/log/mysql $ pwd /var/log/mysql $ cd my_pictures cd /home/labuladong/my_pictures