1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 06:07:44 +00:00
nu_scripts/sourced/cool-oneliners/top_commands.nu
Jonas e4d721e08b
Top commands one-liner (#926)
This pull request adds a script containing a one-liner that can be used
to get a table containing the top 5 used commands by using the history
file
2024-08-09 08:05:41 -05:00

2 lines
254 B
Text

# 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!" }