[root@libin5 shell]# vim shell3.sh
#!/bin/bash
cd /var/log
sum=0
for i in `ls -r *`
do
if [ -f $i ];then
let sum++
echo "文件名:$i"
fi
done
echo "总文件数量为:$sum"
标签:文件,log,文件名,sum,Linux,var From: https://www.cnblogs.com/libin-linux/p/16901368.html
[root@libin5 shell]# vim shell3.sh
#!/bin/bash
cd /var/log
sum=0
for i in `ls -r *`
do
if [ -f $i ];then
let sum++
echo "文件名:$i"
fi
done
echo "总文件数量为:$sum"
标签:文件,log,文件名,sum,Linux,var From: https://www.cnblogs.com/libin-linux/p/16901368.html