Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 日期未显示在shell程序中_Linux_Bash - Fatal编程技术网

Linux 日期未显示在shell程序中

Linux 日期未显示在shell程序中,linux,bash,Linux,Bash,我正在使用这个shell程序,我需要显示一些特定任务的日期和时间。由于某种原因,日期不起作用,它只显示时间 date +'%H:%M:%S Calling' >> /home/hmm/AppFlatForRent/log.txt #calling 有人能告诉我它有什么问题吗?您只是在为date命令添加格式,时间单位为小时分秒,即“%H:%M:%S”。尝试: 在shell中,尝试:man date,它将解释所有选项 date +'%Y-%b-%d %H:%M:%S Calling'

我正在使用这个shell程序,我需要显示一些特定任务的日期和时间。由于某种原因,日期不起作用,它只显示时间

 date +'%H:%M:%S Calling' >> /home/hmm/AppFlatForRent/log.txt #calling

有人能告诉我它有什么问题吗?

您只是在为date命令添加格式,时间单位为小时分秒,即“%H:%M:%S”。尝试:

在shell中,尝试:man date,它将解释所有选项
date +'%Y-%b-%d %H:%M:%S Calling' >> /home/hmm/AppFlatForRent/log.txt #calling