solaris date命令 1.获取系统当前时间: date ‘+%Y%m%d%H%M%S’ 年月日时分秒 例如:20070706110300 2.修改系统时间: 格式为date mmddHHMMYYYY.SS,即月日时分年.秒 sh脚本中将date执行的结果付给一个变量时,用以下方式: currdate=` date ‘+%Y%m%d%H%M%S’`,需要说明的是等号后面的date命令是用反引号引起来的。 文件: [HOLER]solaris date 命令.rar 大小: 3KB 下载: 下载 holer [email=holeryu@hotmail.com]holery...
by holeryu - Solaris文档中心 - 2007-07-06 11:15:07 阅读(1587) 回复(0)
在命令行用date命令,输出 2004年06月14日 星期一 16时21分03秒 GMT 在crontab中用date命令,输出 Mon Jun 14 04:32:00 EDT 2004 两者相差12个小时,怀疑是时区的问题. 但是不知道问题出在什么地方??? 请教.谢谢!!!
在命令行用date命令,输出\r\n2004年06月14日 星期一 16时21分03秒 GMT\r\n\r\n\r\n在crontab中用date命令,输出\r\nMon Jun 14 04:32:00 EDT 2004\r\n\r\n\r\n\r\n两者相差12个小时,怀疑是时区的问题.\r\n但是不知道问题出在什么地方???\r\n请教.谢谢!!!
系统:solaris 8 问题:我在系统中写了自动备份脚本,每天生成文件名如:test`date +%m``date +%d`.则今天会自动生成文件test1230,但我想删除昨天生成的文件或两天前的文件(test1229, test1228),请问此时我的脚本对date该怎么用?
Complete list of FORMAT control characters supported by date command FORMAT controls the output.It can be the combination of any one of the following: %% a literal % %a locale's abbreviated weekday name (e.g., Sun) %A locale's full weekday name (e.g., Sunday) %b locale's abbreviated month name (e.g., Jan) %B locale's full month name (e.g., January) %c locale's date and time (e.g., Thu Mar 3 ...
#ls -lrt -rw-r----- 1 root other 10 Sep 17 00:21 file1 -rw-r----- 1 root other 10 Sep 17 00:21 file2 -rw-r----- 1 root other 111207 Sep 17 2008 file3 -rwxr-x--- 1 root other 1320 Sep 17 2008 file4 请看为什么我改过系统时间后,系统时间只记录年份,而没有具体的时间。
怪!!!solaris 8 中date无法将系统时间修改? 首先位root用户 #date 112811142003 输出为期望值,但是再次输入date命令显示当前时间 #date 输出为1999年,但是月日和时间正确,只是在年份上不对??