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?

link|improve this question

60% accept rate
feedback

2 Answers

up vote 7 down vote accepted

use the du command

du -m filename
link|improve this answer
7  
If you use du -h instead, it'll chose (and print) the appropriate units. – Dentrasi Jun 22 '10 at 21:28
4  
If you use du -ms folder, it will report the size of the folder contents. – KeithB Jun 22 '10 at 21:35
feedback

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

link|improve this answer
+1 ncdu is great – bedwyr Jun 23 '10 at 14:49
feedback

Your Answer

 
or
required, but never shown

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