Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Need to count files & create log of that.

    Hi Friends,
    I need some help. First look at my files hierchachy.


    eg. :


    I want to find out the list of level-3 folders, which contain more that 2 TIF images. I want list of full path from date to that tif image.

  2. #2
    This assumes that the level-1 directory is 2010-07-01, but you could modify that, too...
    dirs=$(find /2010-07-01/*/* -type d)
    for dir in $dirs; do
      echo -e "\nDir:   $dir"
      declare -a files
      files=($(find $dir -type f -name '*.tif'))
      echo Files: ${#files[*]}
      if [ ${#files[*]} -gt 2 ]; then
        for file in ${files[*]}; do
          echo $file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts