本文共 402 字,大约阅读时间需要 1 分钟。
在shell里想要显示时间,必须位day=”$(date +%Y%m%d)”,这样才可以,比如我的log文件名为access_log.20110919,想要用shell脚本来查看这个文件是否存在,就得用一下的shell来查询:
size='/tmp/logs/access_log.'
[root@244835 tmp]# ./3.sh
[root@244835 logs]# ll | grep access_log.20110919
-rw-r--r-- 1 root root 1146696 Sep 19 21:17 access_log.20110919
转载地址:http://tgjll.baihongyu.com/