add du-command 💻

This commit is contained in:
francesco 2021-10-13 01:05:46 +02:00
parent 1cb7d05644
commit 626ba837c8

View File

@ -17,3 +17,46 @@ Find and delete with no overhead
```bash
find / -name .DS_Store -print0 | xargs -0 rm
```
## du
du - estimate file space usage [man-page](https://man7.org/linux/man-pages/man1/du.1.html)
[example How to Get the Size of a Directory in Linux](https://linuxize.com/post/how-get-size-of-file-directory-linux/)
```bash
sudo du -sh /var
# Output
85G /var
```
```bash
sudo du -shc /var/*
# Output
24K /var/db
4.0K /var/empty
4.0K /var/games
77G /var/lib
4.0K /var/local
0 /var/lock
3.3G /var/log
0 /var/mail
4.0K /var/opt
0 /var/run
196K /var/spool
28K /var/tmp
85G total
```
```bash
sudo du -h /var/ | sort -rh | head -5
# Output
85G /var/
77G /var/lib
75G /var/lib/libvirt/images
75G /var/lib/libvirt
5.0G /var/cache/pacman/pkg
```