Junior — Middle
How can you determine the space occupied by a specific folder in a Linux system?
sobes.tech AI
Answer from AI
To determine the space occupied by a specific folder in Linux, the du (disk usage) command is used.
Example:
du -sh /path/to/folder
-s— summarizes the total size of the folder without listing sizes of individual subfolders.-h— displays size in a human-readable format (KB, MB, GB).
To see the size of each subfolder:
du -h --max-depth=1 /path/to/folder
This shows the size of each first-level subfolder inside the specified directory.