From 2e1493037b06eb97bf9e07693a974afadbf94386 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 14 Sep 2016 18:20:11 +0200 Subject: [PATCH] nix path-info: Add some more examples --- src/nix/path-info.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc index d8b6232d4..a9b33e187 100644 --- a/src/nix/path-info.cc +++ b/src/nix/path-info.cc @@ -46,7 +46,15 @@ struct CmdPathInfo : StorePathsCommand }, Example{ "To print the 10 most recently added paths (using --json and the jq(1) command):", - "nix path-info --all --json | jq -r 'sort_by(.registrationTime)[-11:-1][].path'" + "nix path-info --json --all | jq -r 'sort_by(.registrationTime)[-11:-1][].path'" + }, + Example{ + "To show the size of the entire Nix store:", + "nix path-info --json --all | jq 'map(.narSize) | add'" + }, + Example{ + "To show every path whose closure is bigger than 1 GB, sorted by closure size:", + "nix path-info --json --all -S | jq 'map(select(.closureSize > 1e9)) | sort_by(.closureSize) | map([.path, .closureSize])'" }, }; }