Getting folder more than 100K size

Hi ,

I am trying to get the folder details having size more than sme specified value and also the name of the folder should be like TEST.

so

  1. In the current directory search for all the folders having name like TEST
  2. Print the list of the folder names having size more than 100 Kilobyte.

Please help.

find . -type d -name "*TEST*" -size +102400c -print

One way:

find . -type d -exec du -s '{}' \; | awk '$1>100{print $2}'

@Pikk45:
Your solution is relying on the size shown by the ls -l output which actually is the block size for a directory. The size of directory should be determined by the total accumulated size of all files present in the directory which du command does.

Guru.

Cool!! You are the GURU :slight_smile:

But when you execute the command of yours, won't it take the present directory that is "." into account as well? <whisper: Got you on this one :D>