I am trying to find directories in a given size but it doesn't display. I am running the code on the desired directory and I run
du -h --maxdepth 1
To make sure that the directories have the sizes I want to find. But when I run:
find . -maxdepth 1 -type d -size +5M -size -3M
it doesn't display anything.
You're supplying mutually exclusive requirements, so nothing can match.
Use an or.
If that gets no hits, maybe none of the directories at
-maxdepth 1fit the conditions. Try removing that.I think you're not going to
finda lot of directories >5M, though.findisn't reporting the same data asdu. It's a lot like thelsvsduquestioned asked here.maybe what you want is something more like one of these.