Reputation: 64944
How can I see, for example, what are my most used commands in the last 6 months in bash? Can I store this data somewhere?
Upvotes: 10
Views: 2828
Reputation: 6163
You want the lastcomm
command. You'll need to install and/or activate the "acct" package - how to do this depends on your operating system.
Upvotes: 1
Reputation: 4554
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rn|head -30
From a thread on the Arch Linux boards
Upvotes: 19
Reputation: 593
I'm not sure how far back it will go, but bash's history
command will tell you your previous commands. Maybe it can be configured to store up to 6 months of data and then a grep/sed/etc spell can tell you what you want?
Upvotes: 0