How to get file/folder size with SSH on linux?

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?


use the du command

du -m filename

 du -msh FolderName 

will get the size with units. Unlike using -h, this will show a single size, while -h shows all the individual files within the folder.
e.g.

349M    FolderName 

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

ncdu_screenshot