in reply to Ranking files, largest to smallest

As far as getting the file size: I recommend the stat function. Or, -s as has already been shown.