Ubuntu – How to see the memory occupied by a file and folder and also entire directory from terminal

command linedirectoryfilesmemory usage

I'm having some files and folders in the "My Documents" directory. What are the commands to see the size of a file and directory in a terminal?

Best Answer

This will summarise the sizes of the directories:

du -h

PS: Although all computer storage is technically "memory", this term is usually reserved for non-persistent storage like RAM and CPU cache.