Skip to content

Commit 94b1913

Browse files
committed
feat(diskspace): ✨ Add a few improvements on disk cleanup
1 parent 7dda91e commit 94b1913

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

71_disk_usage/CLEANUP..md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# CLEANUP
2+
3+
`.terraform` and `node_modules` folders.
4+
5+
## Find
6+
7+
Find folders and remove them.
8+
9+
```sh
10+
FOLDER_NAME=".terraform"
11+
FOLDER_NAME="node_modules"
12+
13+
find ./ -iname "${FOLDER_NAME}" -type d -exec echo {} \;
14+
15+
# show size first
16+
find ./ -iname "${FOLDER_NAME}" | xargs gdu -sh
17+
```
18+
19+
## Remove
20+
21+
Remove folders that use a huge amount of space for providers.
22+
23+
```sh
24+
find ./ -iname "${FOLDER_NAME}" -type d -exec rm -r {} \;
25+
```
26+
27+
## Resources

71_disk_usage/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DISK USAGE
22

3-
Demonstrate some examples of calculating disk usage.
3+
Demonstrate some examples of calculating disk usage.
44

55
## gdu
66

@@ -10,12 +10,15 @@ Uses SSD parallel reads to rapidly summarise folder sizes.
1010
nix-shell -p gdu --command zsh
1111

1212
gdu
13+
14+
# disk usage (depth 1)q
15+
gdu -h -d1 ./
1316
```
1417

1518
## Space
1619

1720
```sh
18-
# find files or folders and show disk space used for them.
21+
# find files or folders and show disk space used for them.
1922
find /output -iname "share" -or -iname "include" | xargs du -sh
2023

2124
# summarise each folder (depth 1)
@@ -24,12 +27,12 @@ echo ../* | du -h -d1
2427

2528
## inodes
2629

27-
You can change the number of inodes when creating the filesystem.
30+
You can change the number of inodes when creating the filesystem.
2831

2932
```sh
3033
df -i
3134
```
3235

3336
## Resources
3437

35-
* Pretty fast disk usage analyzer written in Go. [here](https://github.com/dundee/gdu)
38+
- Pretty fast disk usage analyzer written in Go. [here](https://github.com/dundee/gdu)

0 commit comments

Comments
 (0)