1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-04 03:55:22 +02:00
tldr/pages/common/nix-collect-garbage.md

18 lines
558 B
Markdown
Raw Normal View History

2018-05-06 11:38:47 +02:00
# nix-collect-garbage
> Delete unused and unreachable nix store paths.
> Generations can be listed using `nix-env --list-generations`.
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-collect-garbage.html>.
2018-05-06 11:38:47 +02:00
- Delete all store paths unused by current generations of each profile:
`sudo nix-collect-garbage {{[-d|--delete-old]}}`
2018-05-06 11:38:47 +02:00
- Simulate the deletion of old store paths:
`sudo nix-collect-garbage {{[-d|--delete-old]}} --dry-run`
2018-05-06 11:38:47 +02:00
- Delete all store paths older than 30 days:
`sudo nix-collect-garbage --delete-older-than 30d`