Skip to the content.

Linux Common Commands

Table of Contents

查看 MD5 值

# md5 字符串
md5Value=$(echo -n "string" | md5sum | cut -d " " -f1)
# md5 文件
md5Value=$(md5sum file | cut -d " " -f1)

获取 Timestamp

date +%s

date +(%Y-%m-%d)

Bash 详细输出

Jenkins uses the shebang, by default

#!/bin/sh -e

-x will prompt those verbose details, if you’d like to reset that you can set the default shebang in your shell build step with something like

#!/bin/sh -xe