xinghe0 发表于 2018-8-29 10:30:56

shell脚本显示选定路径下大于特定值文件

  #!/bin/sh
  read -p "please input the lujing:" a
  if [ ! -d $a ]; #判断是否为目录,不是目录则
  then
  echo "not a mulu" #显示不是一个目录
  else
  for i in `find $a -type f |xargs ls -l |awk '{if ($5>102400) {print $9}}'` #大于100k则显示文件名
  do
  ls -l $i #将文件显示出 并且显示大小
  done
  fi
  # sh ../mv.sh
  please input the lujing:/usr/shell/
  -rw-r--r-- 1 root root 5242880 4月   1 00:48 /usr/shell/1
  -rw-r--r-- 1 root root 5242880 4月   1 00:48 /usr/shell/2
  -rw-r--r-- 1 root root 5242880 4月   1 00:48 /usr/shell/3
  -rw-r--r-- 1 root root 4194304 4月   1 02:41 /usr/shell/xwj/xxx3
  =================生成目录html页面====================
  #bin/sh
  b=`pwd`
  echo "
  
  
  Index of $b
  
  
  Index of $b

  "\""  ">1.html
  for a in $(ls -l|awk '{print $9}')
  do

  echo ""\""  done
  echo "
  " >>index.html

页: [1]
查看完整版本: shell脚本显示选定路径下大于特定值文件