cancel
Showing results for 
Search instead for 
Did you mean: 
DavidOBrien
Starfighter Starfighter
Starfighter
  • 15.7K Views

Which terminal command do you use the most?

I rely on command history a *lot* and I was curious to know which commands I use the most. I found this on Reddit, and the results are interesting. You might have to tweak the command a bit to suit your shell.

$ history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
     1  1697  17.5491%    git
     2  1309  13.5367%    cd
     3  673   6.95967%    flamel
     4  520   5.37746%    find
     5  443   4.58118%    vi
     6  322   3.32989%    ll
     7  300   3.10238%    rm
     8  283   2.92658%    grep
     9  279   2.88521%    exit
    10  277   2.86453%    history

So which commands use up your day?

Tags (3)
33 Replies
delhage
Flight Engineer Flight Engineer
Flight Engineer
  • 9,971 Views

Mine is similar:

$ history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
     1  102  20.4%  git
     2  87   17.4%  oc
     3  65   13%    ls
     4  39   7.8%   cd
     5  26   5.2%   vim
     6  23   4.6%   less
     7  18   3.6%   ssh
     8  18   3.6%   make
     9  15   3%     grep
    10  12   2.4%   gopass
https://www.nohup.se/key-transition-2018-08-16.txt
Susan
Flight Engineer Flight Engineer
Flight Engineer
  • 9,966 Views

You can even vote in the opensource.com article that was posted yesterday with this command as well as a reference to the reddit post from a few weeks ago.

My top 5 are:

1 180 18% ls
2 156 15.6% git
3 137 13.7% cd
4 82 8.2% sudo
5 70 7% evince

 

PeterTselios
Starfighter Starfighter
Starfighter
  • 9,961 Views

Here is my top10. (I cheated a little bit because I excluded cd :) )

    1  59  13.0531%   ssh
    2  54  11.9469%   ansible-playbook
    3  52  11.5044%   ll
    4  38  8.40708%   dig
    5  30  6.63717%   cat
    6  20  4.42478%   ansible-doc
    7  19  4.20354%   history
    8  18  3.9823%    rm
    9  17  3.76106%   sudo
   10  13  2.87611%   more

waiyanmin
Flight Engineer Flight Engineer
Flight Engineer
  • 9,939 Views

history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
     1    674  67.4% 


@DavidOBrien wrote:

I rely on command history a *lot* and I was curious to know which commands I use the most. I found this on Reddit, and the results are interesting. You might have to tweak the command a bit to suit your shell.

$ history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
     1  1697  17.5491%    git
     2  1309  13.5367%    cd
     3  673   6.95967%    flamel
     4  520   5.37746%    find
     5  443   4.58118%    vi
     6  322   3.32989%    ll
     7  300   3.10238%    rm
     8  283   2.92658%    grep
     9  279   2.88521%    exit
    10  277   2.86453%    history

So which commands use up your day?




     5    17   1.7%   discovery
     6    16   1.6%   -y
     7    14   1.4%   vsftpd
     8    13   1.3%   cifs
     9    11   1.1%   iscsid
    10    10   1%     *

George-Hacker
Flight Engineer Flight Engineer
Flight Engineer
  • 9,924 Views

Here is my top ten:

     1	1023  18.7157%    ls
     2	407   7.44603%    vim
     3	360   6.58617%    cd
     4	306   5.59824%    gpg
     5	297   5.43359%    svn
     6	200   3.65898%    rm
     7	189   3.45774%    clear
     8	177   3.2382%     ssh
     9	159   2.90889%    mv
    10	159   2.90889%    evince

svn is still on the list because I do must of my reviews using a browser to access GitHub. You can probably guess what my favorite editor is... :manwink:

jessesar
Cadet
Cadet
  • 9,916 Views

People who know me won't be surprised to see both 'cat' and 'for' in my top 10 as I'm well known for creating/using crazy one-liners which are often wrapped in 'for' loops and/or involve 'cat' with 'while read'.

     1	727  9.75708%    ls
     2	713  9.56919%    oc
     3	665  8.92498%    cat
     4	570  7.64998%    cd
     5	487  6.53604%    git
     6	357  4.7913%     aws
     7	253  3.39552%    sudo
     8	194  2.60368%    for
     9	191  2.56341%    vi
    10	167  2.24131%    curl

Though this is a new laptop and my recent work has me remoting into bastion hosts and running commands in there which aren't counted :(

andreamtp
Mission Specialist
Mission Specialist
  • 9,909 Views

Hi,
     since I do work mainly on remote system, nothing uber fancy happen locally ;-)

     1  3993  18.0728%     cd
     2  3777  17.0951%     ssh
     3  3128  14.1577%     ll
     4  1175  5.31819%     su
     5  940   4.25455%     vim
     6  585   2.64778%     cat
     7  430   1.94623%     git
     8  411   1.86023%     ls
     9  407   1.84213%     scp
    10  351   1.58867%     clear

 

  • 9,903 Views

I'm running ZSH on Arch so I had to modify the  command a hair, and it's my personal play toy and not my work computer...

 

% history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10

1 1665 16.6517% ls
2 1389 13.8914% cd
3 909 9.09091% pacaur
4 497 4.9705% sudo
5 487 4.87049% rm
6 357 3.57036% cat
7 344 3.44034% vim
8 301 3.0103% git
9 287 2.87029% docker
10 235 2.35024% emacs

 

DTherHtun
Mission Specialist
Mission Specialist
  • 9,888 Views

1 375 43.911%
2 22 2.57611% pull
3 22 2.57611% docker
4 21 2.45902% -u
5 19 2.22482% policy
6 19 2.22482% images
7 19 2.22482% add-role-to-user
8 18 2.10773% nodes
9 17 1.99063% pods
10 17 1.99063% pod

Join the discussion
You must log in to join this conversation.