Hi I want to find count of file between 2 size (for example 1k and 2k) in linux, I found that the code return the count of exact size in a directory and it work fine:
find DIR_NAME -type f | wc -l
could anyone help me how I do find between 2 size? And is it possible that I find the count of Hiden
file via find
command?
Advertisement
Answer
Use two size
flags together for this and use +
, -
for greater than and less than size.
find DIR_NAME -type f -size +1k -size -2k | wc -l