Find by size in fedora

RezaHS75

Honorable
Dec 31, 2013
16
0
10,510
hello. in fedora I want to find all *.rpm files that their size are more than 0bytes how i can do this?
I can find all *.rpm files with this instruction:
find -name "*.rpm" -exec cp {} /dest/of/copy/ \;
but i want to copy all rpm files that their size is more than 0bytes Is there any way?
 
Solution
find -name "*.rpm" -type f ! -size 0 -exec cp {} /dest/of/copy/\;

should do the trick. But why do you have empty .rpm files?

RezaHS75

Honorable
Dec 31, 2013
16
0
10,510
thank u very very much ljack it works.
But answer of your question:
I want to get all rpm files in /var/cache/yum/x86_64/20 to a local directory to create a local repository but before you answered me I do this with instruction that I write it in my question. My problem was that instruction copied 0bytes rpm files and when I tried to careate a repository of them with createrepo The createrepo give me error with 0byte files and says 'could not open <name of file>'. this happend for 0byte files so that was the reason that I answer this question and u help me thanks.