Command line productivity (Part 1)

Being productive, we all want it, we rarely implement it. Most of the time, we have no idea where to start.

Since I spend most of my day in terminal, I felt this is a place I can make more productive. It is already made more pleasant to look at by choosing a custom font and tweaking several other settings.I also spent time to learn terminal shortcuts (iterm2), so I can quickly split windows, switch tabs etc. If you don’t do  those things in your terminal, and that is where you spend your day, you should start by learning shortcuts and customizing settings. One great terminal I really enjoy on Linux is Terminator. On Windows there is PowerShell and Console2.

I tried to make OSX open in terminal on startup, like you could do in Linux, but I didn’t find simple way to do this. I don’t shut down it anyway, so it is OK.

So, how can we be more productive on command line. For start, I wanted to learn better how I use commands and what and how often I am using them. From few years back I remember someone had neat oneliner that would analyze frequency of command in history.

Didn’t have to search long to find this blog post ‘Command Line Analytics

In essence all you need to enter is this command:

history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head -10

It goes through your history, takes first part of command line entered, sorts it, takes first 10 items and displays them along with frequency of usage. For my analysis, I wanted to see top 25 commands I used:

3014 git
630 cd
568 ls
378 brew
355 mvim
304 ack
285 bundle
281 rm
260 be
204 rake
180 rvm
169 ssh
165 tig
160 lime
150 gem
142 cat
121 curl
117 l
109 sudo
90 rails
86 open
79 npm
79 gd
73 touch

Some of these are duplicates, like ls and l (l is alias for ls) mvim and lime are editors.

Let’s stare at this for a moment… I will continue tomorrow on what I did next.

Command Line Productivity (Part 2)

Advertisements

2 thoughts on “Command line productivity (Part 1)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s