Skip to content

Commit

Permalink
Top commands one-liner (#926)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
phoenixr-codes authored Aug 9, 2024
1 parent 5eb484f commit e4d721e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sourced/cool-oneliners/top_commands.nu
Original file line number Diff line number Diff line change
@@ -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!" }

0 comments on commit e4d721e

Please sign in to comment.