查看当前目录下的文件:
find . -type f
查看当前目录下的文件夹:
find . -type d
如果文件file1不为空:
if [ -s file1 ];then
     echo "file1 不为空"
fi
#!/bin/shfor f in `find ./testdir -type f`;do        if [ -s $f ];then                echo $f is not empty.                echo copy $f                cp $f ~/backup        else                echo $f is empty.        fidone#!/bin/bashfind /etc -type f > list.txtwhile read line; do    size=$(ls -l $line | awk '{print $5}')    if [[ $size != 0 ]]; then        cp $line /tmp/    fidone < list.txt 
                    
                     
                    
                 
                    
                 posted on
 posted on 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号