diff --git a/sourced/cool-oneliners/top_commands.nu b/sourced/cool-oneliners/top_commands.nu new file mode 100644 index 000000000..b060d44df --- /dev/null +++ b/sourced/cool-oneliners/top_commands.nu @@ -0,0 +1,2 @@ +# Evaluates the top 5 most used commands present in `nushell/history.txt`. +if $nu.history-enabled { open $nu.history-path | lines | uniq --count | sort-by --reverse count | first 5 | rename command amount } else { print --stderr "History is disabled!" }