Ubuntu query hard disk usage and file or folder size command

[Ubuntu] query hard disk usage and file or folder size command

When using the ubuntu system, it is often necessary to check the remaining space of the system and the size of the directory. This is a common command:

1. Disk space usage

df -h

2. The size of all files and folders in the current directory

## Simplified version of du --max-depth=1 -h 
du -hd 1

3. View individual file or folder size

du  -sh file 
du  -sh dir

Leave a Comment

Your email address will not be published. Required fields are marked *