One - One Code All

Blog Content

shell脚本中获取当前的年月日时分秒

Linux-Mac   2008-10-13 14:28:04

获取当前的时间
date=date "+%Y-%m-%d %H:%M:%S"

获取前一天的时间
date=date -d yesterday "+%Y%m%d"



上一篇:linux运行脚本函数
下一篇:Shell脚本中实现切换用户并执行命令操作

The minute you think of giving up, think of the reason why you held on so long.