I want to check the file size in shell script. I am trying to check if the file in a specific directory exceeded 2 gb i.e 2147483648 bytes.
How can I easily do this in shell script?
I have the following 2 files:
-rw-rw-rw- 1 op general 1977591120 Jul 02 08:27 abc -rw-rw-rw- 1 op general 6263142976 Jul 01 18:39 xyz
When I run find . -size +2047MB
, I get both the files as output
./abc ./xyz
I expect only xyz in the output size it is ~6gb and abc is slightly less than ~2gb. WHat can be the reason for both files showing up in the output?