1 #!/bin/sh
 2 
 3 export DS_DIR=/home/cxy/test
 4 
 5 if [ ! -d $DS_DIR ]; then
 6     mkdir $DS_DIR
 7 else
 8     echo "$DS_DIR is not existed!"
 9 fi
10 
11 cd $DS_DIR
12 if [ $(ls -l | grep "install-*" | wc -l) > 3 ]; then
13     echo "more than 2 dst_files in $DS_DIR"
14     rm -r $(ls -rt | head -n2)
15 fi

 

相关文章:

  • 2021-07-28
  • 2022-12-23
  • 2021-11-21
  • 2021-12-26
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-08
  • 2021-06-03
  • 2021-05-28
  • 2021-06-23
  • 2021-08-21
  • 2021-11-08
相关资源
相似解决方案