Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using SSH to connect to a CentOS server and I want to get the file in mb of some files and folders, how can I do it?

share|improve this question

3 Answers 3

up vote 25 down vote accepted

use the du command

du -m filename
share|improve this answer
If you use du -h instead, it'll chose (and print) the appropriate units. – Dentrasi Jun 22 '10 at 21:28
If you use du -ms folder, it will report the size of the folder contents. – KeithB Jun 22 '10 at 21:35
Is there a way where we can see the units - example mb, kb or any other information? – TheBlackBenzKid Mar 25 '13 at 9:58

du is the primary tool for this, but if you're looking for something more interactive, I quite like ncdu

share|improve this answer
+1 ncdu is great – bedwyr Jun 23 '10 at 14:49
 du -msh FolderName 

will get the size with units.

349M    FolderName 
share|improve this answer

protected by bwDraco Aug 20 at 2:13

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.