total 8 -rwxrwxr-x 1 pentester pentester 136 6月 19 15 : 58 is_Empyt.sh -rw-r--r-- 1 root root 7 6月 19 15 : 59 myfile.txt

查看脚步内容:

# cat is_Empyt.sh 
#! /bin/bash
if [ -s ./myfile.txt ] ; then 
  echo 'ths file is not empyt and file info:'
  du -sh myfile.txt  #打印文件大小
  echo 'empty!'

执行效果:

# ./is_Empyt.sh 
ths file is not empyt and file info:
4.0K    myfile.txt