Take the 2-minute tour ×
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 21 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 -msh FolderName 

will get the size with units.

349M    FolderName 
share|improve this answer

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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