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天前的时间
SHELL基本命令备忘
猜你喜欢
转载自leovlys.iteye.com/blog/2183328
今日推荐
周排行