Most frequently used commands on the console

For a bioinformatician, nothing matches the speed and efficacy of the command line once you are used to it. The point and click interface of many tools simply don’t cut it when it comes to the power and flexibility of command lines and shell scripts. More importantly, scripts can be combined with other scripts, put in version control and adapted to work with other systems.

As Matt Might says, “The continued dominance of the command line among experts is a testament to the power of linguistic abstraction: when it comes to computing, a word is worth a thousand pictures.”

So I tried to see what are the most common commands I use on the command line. So with a first pass using the command

farhat@heracles:~$ cut -f1 -d' ' .bash_history |sort |uniq -c|sort -n|tail -20
13 mv
13 paste
14 bg
15 history|grep
17 wc
18 ~/software/bwa-0.7.5a/bwa
20 samtools
23 bedtools
28 less
32 scp
38 vi
42 rm
49 head
49 sudo
54 tail
66 screen
106 top
112 cat
397 cd
587 ls

 

Not surprisingly, ls and cd are there are lot. As is screen, that probably means a number of commands are missed from this list. samtools comes less freuqently than bedtools and that may be because samtools is often a part of pipelines and that will make it appear less frequently than it is used. So let’s correct for that:


farhat@heracles:~$ sed 's/|/\n/g' .bash_history| sed 's/^ //' | cut -f1 -d' ' |sort |uniq -c|sort -n|tail -20
14 bg
18 ~/software/bwa-0.7.5a/bwa
23 bedtools
23 history
32 scp
38 vi
39 samtools
41 wc
42 rm
49 sudo
66 screen
67 gawk
67 tail
79 grep
84 less
106 top
111 head
115 cat
397 cd
587 ls

With that change we see that samtools does go much farther ahead than bedtools. This also indicates which commands are ripe for optimization. Even a few keystrokes saved on the most frequently used commands can save a fair bit of time.

Advertisements

Author: Farhat

I am a physicist turned bioinformatics researcher turned Data Scientist.

Leave a Reply

Fill in your details below or click an icon to log in:

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