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:
parent
5eb484f986
commit
e4d721e08b
1 changed files with 2 additions and 0 deletions
2
sourced/cool-oneliners/top_commands.nu
Normal file
2
sourced/cool-oneliners/top_commands.nu
Normal 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!" }
|
Loading…
Add table
Add a link
Reference in a new issue