7
I need to find a file in my current directory whose size should be less than or equal to 10 MB.
ls -lh
gives me the file size of each file but not sure how to find the files whose size are less than or equal to 10 MB.
host@407d:t1_snapshot$ ls -lth
Is there any way I can do that? I am running ubuntu 12.04
3
-maxdepth 1
avoids recursing into subdirectories, if that's unwanted. – Dennis – 2013-12-10T23:39:46.643@dennis good addition. – PsychoData – 2013-12-10T23:42:12.700
5Also, by default
-size
takes 512-byte blocks as its argument. For 10 MB, use-size -10000000c
or-$((10**7))c
. For 10 MiB, just use-size -10M
. – Dennis – 2013-12-10T23:48:16.007