Use find with the size option. The size option takes one argument. -5000k means less than while +5000k means greater than 5MB.
Examples -
To find mp3 files of size < 5 MB
$ find /mp3collection -name '*.mp3' -size -5000k
To find file of size > 10MB
$ find / -size +10000k
To find file of size > 180MB but < 190 MB.
For example if I want to find files for the Friends episodes in my hard disk which I know are approx. ~ 185MB.
$ find / -size +180000k -and -190000k
Practice -
Guess what the following command does?
$ find /mp3-collection -name 'Metallica*' -and -size +10000k
For more, see http://www.codecoffee.com/tipsforlinux/articles/21.html
Examples -
To find mp3 files of size < 5 MB
$ find /mp3collection -name '*.mp3' -size -5000k
To find file of size > 10MB
$ find / -size +10000k
To find file of size > 180MB but < 190 MB.
For example if I want to find files for the Friends episodes in my hard disk which I know are approx. ~ 185MB.
$ find / -size +180000k -and -190000k
Practice -
Guess what the following command does?
$ find /mp3-collection -name 'Metallica*' -and -size +10000k
For more, see http://www.codecoffee.com/tipsforlinux/articles/21.html
Comments