1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 06:07:44 +00:00

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
This commit is contained in:
Jonas 2024-08-09 15:05:41 +02:00 committed by GitHub
parent 5eb484f986
commit e4d721e08b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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