cancel
Showing results for 
Search instead for 
Did you mean: 
DavidOBrien
Starfighter Starfighter
Starfighter
  • 16.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
SachinJain
Mission Specialist
Mission Specialist
  • 5,390 Views

1 3077 19.2397% cd
2 2593 16.2133% ls
3 1787 11.1736% ll
4 1231 7.69712% ssh
5 638 3.98925% vim
6 492 3.07635% ping
7 466 2.91377% 25 (alias)
8 373 2.33227% sudo
9 367 2.29475% pwd
10 366 2.2885% scp
0 Kudos
ddeimeke
Mission Specialist
Mission Specialist
  • 5,381 Views

     1  196  19.2157%    ssh
     2  135  13.2353%    cd
     3  120  11.7647%    ls
     4  62   6.07843%    ansible-playbook
     5  56   5.4902%     cat
     6  55   5.39216%    task
     7  54   5.29412%    vim
     8  34   3.33333%    git
     9  30   2.94118%    for
    10  26   2.54902%    sudo
0 Kudos
kondor6c
Cadet
Cadet
  • 5,350 Views

Very neat, you can tell you utilize BASH very well due to "for" ranking on your top ten. 

GPG ID: 0xC5D5F4BED24A4A02
0 Kudos
rdekens
Mission Specialist
Mission Specialist
  • 5,378 Views

     1    674  67.4%
     2    51   5.1%   --config
     3    28   2.8%   group
     4    27   2.7%   list
     5    16   1.6%   |
     6    14   1.4%   ssh login (obfuscated)
     7    11   1.1%   ssh login (obfuscated)
     8    10   1%     grep
     9    8    0.8%   --help
    10    7    0.7%   -L

0 Kudos
BillS
Cadet
Cadet
  • 5,377 Views

     1  747  13.0663%    cat
     2  443  7.74882%    cd
     3  338  5.91219%    less
     4  269  4.70526%    cp
     5  254  4.44289%    ssh
     6  212  3.70824%    emacs
     7  203  3.55081%    ls
     8  195  3.41088%    vi
     9  192  3.3584%     mv
    10  179  3.13101%    rm
Linux/Satellite
Python/PANDAS/JupyterLab
0 Kudos
Lars
Flight Engineer Flight Engineer
Flight Engineer
  • 5,374 Views


Here is my top ten:

 

1 179 28.1447% git
2 102 16.0377% ls
3 62 9.74843% vim
4 60 9.43396% cd
5 44 6.91824% sudo
6 23 3.61635% gpg2
7 22 3.45912% ssh
8 17 2.67296% cat
9 11 1.72956% yum
10 9 1.41509% rsync
0 Kudos
kondor6c
Cadet
Cadet
  • 5,351 Views

I like your use of rsync, I use rsync almost as my cp/scp. The only issue is that rsync doesn't have an option to copy the SELinux context, or to use the default like cp does, I think that is because of the remote nature of rsync. But I really like the delta copy and verbosity I can get from rsync.

GPG ID: 0xC5D5F4BED24A4A02
0 Kudos
Lemmons
Flight Engineer Flight Engineer
Flight Engineer
  • 5,373 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    1576  14.4667%     cd
     2    1415  12.9888%     ll
     3    1260  11.566%      exit
     4    825   7.57298%     linfo
     5    696   6.38884%     vim
     6    632   5.80136%     git
     7    592   5.43418%     ssh
     8    317   2.90986%     cat
     9    262   2.40499%     sudo
    10    208   1.90931%     ldapsearch

 

No surprises, the local machine is pretty boring!

0 Kudos
AngelReynoso
Mission Specialist
Mission Specialist
  • 5,365 Views

1 119 37.5394% sudo
2 93 29.3375% ls
3 59 18.612% cd
4 10 3.15457% vim
5 6 1.89274% rm
6 4 1.26183% tar
7 4 1.26183% nmap
8 4 1.26183% exit
9 2 0.630915% rpm
10 1 0.315457% yum

0 Kudos
kondor6c
Cadet
Cadet
  • 5,353 Views

Very insightful, and I enjoy the use of awk. I was very shocked to not see grep, and to see pulseaudio, I think that shows how much I have been battling it on my desktop

1 275 8.65869% ssh
2 254 7.99748% cd
3 239 7.52519% sudo
4 225 7.08438% git
5 149 4.69144% ls
6 130 4.0932% vim
7 91 2.86524% cat
8 80 2.51889% man
9 74 2.32997% gopass
10 62 1.95214% pulseaudio


I think if I were permitted to use Linux on my employer's machine or pull from the jumpbox/bastion these results would be different.

 

Side note, I had to remove "s7.addthis.com" from my unbound advertisment blocking list for me to edit text within this web widget. edit: I had to edit the post to format the code snippet

GPG ID: 0xC5D5F4BED24A4A02
0 Kudos
Join the discussion
You must log in to join this conversation.