add du
-command 💻
This commit is contained in:
parent
1cb7d05644
commit
626ba837c8
43
docs/bash.md
43
docs/bash.md
@ -16,4 +16,47 @@ the previous command is due that not all `find` have a delete funcion but with o
|
|||||||
Find and delete with no overhead
|
Find and delete with no overhead
|
||||||
```bash
|
```bash
|
||||||
find / -name .DS_Store -print0 | xargs -0 rm
|
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
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user