`

SHELL基本命令备忘

阅读更多
1. 判断当前用户
if [ "$UID" -eq “0” ]
then
  echo "You are root."
else
  echo "You are just an ordinary user (but mom loves you as the same)."
fi

2. 时间戳
date +%Y%m%d%H%M%S 当前时间
date -d "5 day" +%Y%m%d%H%M%S 5天后的时间
date -d "5 days ago" +%Y%m%d%H%M%S 5天前的时间

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics