cancel
Showing results for 
Search instead for 
Did you mean: 
carbajgu
Mission Specialist
Mission Specialist
  • 489 Views

ex200 / find files by size behaves weird

Jump to solution

Hello!

Cant understand find command behavior. Looks like it is rounding from 1M to 0 and is unable to see nothing below 1M. Does anybody has a better explanation? So, if I want to search with certain precision I should work with k, right? / Regards

 

[root@rhel92vm ~]# find /usr/share -size +10k -a -size -1M|wc -l
0
[root@rhel92vm ~]# find /usr/share -size +10k -a -size -1024k |wc -l
15171
[root@rhel92vm ~]# find /usr/share -size +10k -a -size -2M |wc -l
15171

Labels (2)
1 Solution

Accepted Solutions
tnishiok
Flight Engineer
Flight Engineer
  • 422 Views

The behavior might vary depending on the version of the bundled find package, but at least the manual in RHEL9.2 looks to have the correct explanation.

screenshot.jpg

@carbajgu , so you are right. You should use the command with 'k', or even with 'c' depending on the precision you want to achieve.

Regards,
Toshi

View solution in original post

2 Replies
khokha
Flight Engineer
Flight Engineer
  • 437 Views

Hi,

according to Red Hat

"  -size option rounds everything to single units,files that are smaller than 1 MB are shown with command find -size 1M, as it rounds all files to 1 MB.

tnishiok
Flight Engineer
Flight Engineer
  • 423 Views

The behavior might vary depending on the version of the bundled find package, but at least the manual in RHEL9.2 looks to have the correct explanation.

screenshot.jpg

@carbajgu , so you are right. You should use the command with 'k', or even with 'c' depending on the precision you want to achieve.

Regards,
Toshi

Join the discussion
You must log in to join this conversation.