nix-store

Manipulate or query the Nix store. See also: tldr nix3 store. More information: https://nixos.org/manual/nix/stable/command-ref/nix-store.html.

nix-store --gc

nix-store --optimise

nix-store --delete /nix/store/...

nix-store --query --tree /nix/store/...

du -cLsh $(nix-store --query --references /nix/store/...)

nix-store --query --referrers /nix/store/...