bullsgl

博客园 首页 新随笔 联系 订阅 管理

2013年10月12日 #

摘要: 单个文件较简单if [[ -f filename ]]; then echo existfi文件存在并且有内容if [[ -s filename ]]; then echo existfi带匹配符的多个文件时if ls /path/*.log &> /dev/null; then echo existfi或者需要知道有多少个文件存在时file_count=`find /path -name *.log | wc -l`if [[ file_count > 0 ]]; then echo exits $file_countfi 阅读全文
posted @ 2013-10-12 17:13 bullsgl 阅读(163) 评论(0) 推荐(0)