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?
Asked
Active
Viewed 1.7e+01k times
3 Answers
30
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.
l0b0
- 9,271
10
To see the full size (including whole content) of a folder in a directory, use the command
du -hs YOUR_FOLDER_NAME
To see the full size (including whole content) of all folders and files in a directory, use the command
ls | xargs -I fileorfolder du -hs fileorfolder
loved.by.Jesus
- 667