From time to time I need to see the size of files or folders in my hosting account.

There are many ways to see disk usage; for instance, you can easily go log into your cPanel and find the utility named.

However, I find it too much trouble to do all that just to check the file size. I would rather do it on my terminal. It’s much faster and easier if you know the command.

Probably everybody knows about list command: ls -l or ls -la, but it’s possible that you didn’t know about -h which means humanized. That attribute makes the file sizes look like 142Kb or 1.2 MB, something that we humans can read easily.

Another command is disk usage: du -sh. Disk usage gives you a better display of file sizes in terms of folders.

That’s it.