Which Linux terminal command do you use the most?

Chat about Linux in general
User avatar
BenTrabetere
Level 5
Level 5
Posts: 759
Joined: Sat Jul 19, 2014 12:04 am
Location: Hattiesburg, MS USA

Which Linux terminal command do you use the most?

Post by BenTrabetere » Sun Sep 02, 2018 12:16 pm

I saw this in an Opensource.com article article. The inspiration was a Reddit Reddit thread.

The article provides a command that shows the 10 most-frequently used terminal commands and the percentage of usages. I found it interesting, especially when I increased the count to the Top 25 (substitute -n10 with -n25) and commands that might be worthy of an alias or an AutoKey shortcut.

Code: Select all

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


Here is mine. I cleared history earlier in the week and I do not think the results here are a true representative. An example of atypical usage is the flatpak entry. I only have three flatpaks installed (darktable, GIMP and krita), and I almost never use them.

Code: Select all

     1  139  13.9%   ls
     2  115  11.5%   cd
     3   73   7.3%   ll
     4   52   5.2%   cat
     5   36   3.6%   curl
     6   33   3.3%   sudo
     7   22   2.2%   flatpak
     8   21   2.1%   htop
     9   20   2%     yelp
    10   20   2%     file
I think flatpak usage is so high because this week I was playing around with flatpak command options, rather than actually running an actual flatpak. And when I do run a flatpak application I always run it from the terminal and I always run flatpak list first ... so the flatpak command gets used twice.

Also, ps and kill show up when I increased the count to 25, which makes sense. I use yelp to view man pages, and sometimes it does not exit properly.


The Reddit thread offers an additional command that shows the usage as a bar chart.

Code: Select all

history | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c | sort -n | tail | perl -lane 'print $F[1], "\t", $F[0], " ", "▄" x ($F[0] / 12)'

User avatar
Fred Barclay
Level 12
Level 12
Posts: 4156
Joined: Sat Sep 13, 2014 11:12 am
Location: Bumping around in the bush

Re: Which Linux terminal command do you use the most?

Post by Fred Barclay » Sun Sep 02, 2018 1:01 pm

Interesting! Here's mine:

Code: Select all

     1	91  18.2%  git
     2	71  14.2%  firejail
     3	39  7.8%   make
     4	38  7.6%   packup
     5	36  7.2%   sudo
     6	31  6.2%   ls
     7	27  5.4%   exit
     8	18  3.6%   cd
     9	12  2.4%   pacman
    10	11  2.2%   python
git, python, and a lot of firejail are from my programming projects

packup is an alias that calls pacman and yaourt upgrades on my machine (I'm running Arch, and while I could just use yaourt for all upgrades I prefer to use pacman for in-repo updates).

I'm surprised to see sudo so high on the list. Probably due to me updating Arch and firejail daily -- the firejail updates are where make comes from, by the way.
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein

User avatar
Flemur
Level 16
Level 16
Posts: 6203
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Which Linux terminal command do you use the most?

Post by Flemur » Sun Sep 02, 2018 1:29 pm

Code: Select all

     1	35  13.9442%   cd
     2	25  9.96016%   ls
     3	18  7.17131%   vi
     4	15  5.9761%    df
     5	13  5.17928%   rm
     6	11  4.38247%   W
     7	10  3.98406%   sudo
     8	10  3.98406%   set
     9	7   2.78884%   h
    10	7   2.78884%   grep
h = history
W = find executables.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
smurphos
Level 8
Level 8
Posts: 2042
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Which Linux terminal command do you use the most?

Post by smurphos » Sun Sep 02, 2018 1:34 pm

Interesting - I attempted a hefty git cherry-pick last week bringing my fork of Adapta up to date, and having been doing a lot of messing with xdotool and wmctrl attempting to make desktop mouse scrolling switch workspaces in Cinnamon,

Code: Select all

     1	236  23.6%  git
     2	78   7.8%   sudo
     3	58   5.8%   apt
     4	56   5.6%   wmctrl
     5	39   3.9%   xdotool
     6	28   2.8%   cat
     7	24   2.4%   gsettings
     8	21   2.1%   dpkg
     9	20   2%     history
    10	18   1.8%   pkill

User avatar
MrEen
Level 7
Level 7
Posts: 1734
Joined: Mon Jun 12, 2017 8:39 pm

Re: Which Linux terminal command do you use the most?

Post by MrEen » Sun Sep 02, 2018 1:37 pm

What the heck?

Code: Select all

scott@scott-HP ~ $ 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
scott@scott-HP ~ $ 
history returns 1398 lines

Bar chart version shows:

Code: Select all

31/05/18	18 ▄
13/05/18	19 ▄
20/07/18	19 ▄
08/05/18	20 ▄
14/07/18	20 ▄
16/06/18	20 ▄
15/07/18	35 ▄▄
11/04/18	37 ▄▄▄
22/07/18	41 ▄▄▄
25/08/18	299 ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

User avatar
phd21
Level 17
Level 17
Posts: 7284
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Which Linux terminal command do you use the most?

Post by phd21 » Sun Sep 02, 2018 2:22 pm

Hi Everyone,

This is an interesting post

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 381 38.1% sudo
2 42 4.2% cd
3 41 4.1% utrac
4 34 3.4% ls
5 32 3.2% bash
6 26 2.6% kdesudo
7 23 2.3% locate
8 22 2.2% xed
9 15 1.5% git
10 14 1.4% man


$ history | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c | sort -n | tail | perl -lane 'print $F[1], "\t", $F[0], " ", "▄" x ($F[0] / 12)'
man 14 ▄
git 15 ▄
xed 22 ▄
locate 23 ▄
kdesudo 26 ▄▄
bash 32 ▄▄
ls 34 ▄▄
utrac 41 ▄▄▄
cd 42 ▄▄▄
sudo 381 ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄



...
Phd21: Mint KDE 17.3 & 18.3, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

Valsodar
Level 3
Level 3
Posts: 142
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: Which Linux terminal command do you use the most?

Post by Valsodar » Mon Sep 03, 2018 6:24 pm

Which Linux terminal command do you use the most?
sudo apt-get install

User avatar
Rosko
Level 3
Level 3
Posts: 100
Joined: Tue Jan 05, 2016 6:04 pm
Location: Canada

Re: Which Linux terminal command do you use the most?

Post by Rosko » Mon Sep 03, 2018 6:52 pm

Which Linux terminal command do you use the most?
youtube-dl

perhaps I should be making better use of my time on the computer :wink:

User avatar
all41
Level 13
Level 13
Posts: 4869
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Which Linux terminal command do you use the most?

Post by all41 » Mon Sep 03, 2018 7:04 pm

I consider command line execution history as important, so not only do I increase the storage limit, I keep a backup, and carry that history forward in new releases.
Proud to be a supporter and monthly contributor to Mint.

User avatar
all41
Level 13
Level 13
Posts: 4869
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Which Linux terminal command do you use the most?

Post by all41 » Mon Sep 03, 2018 7:08 pm

Rosko wrote:
Mon Sep 03, 2018 6:52 pm
Which Linux terminal command do you use the most?
youtube-dl
+1
Not at top but it's up in that area :)
Proud to be a supporter and monthly contributor to Mint.

User avatar
BG405
Level 7
Level 7
Posts: 1551
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Which Linux terminal command do you use the most?

Post by BG405 » Wed Sep 05, 2018 3:51 pm

Across my three primary machines, here's the results for the top 25 plus a bar chart for the Acer D255E.

Dell Inspiron 1525 (file & media server and general workstation):

Code: Select all

[brian@SERVER Tower-of-Eightness] $ 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 -n25
     1	141  14.1%  sudo
     2	108  10.8%  cat
     3	92   9.2%   ls
     4	63   6.3%   cd
     5	55   5.5%   man
     6	51   5.1%   ssh
     7	40   4%     htop
     8	39   3.9%   nano
     9	37   3.7%   apt
    10	31   3.1%   minicom
    11	20   2%     python
    12	18   1.8%   wget
    13	18   1.8%   sensors
    14	18   1.8%   inxi
    15	18   1.8%   df
    16	17   1.7%   scp
    17	16   1.6%   lsblk
    18	15   1.5%   free
    19	12   1.2%   mkdir
    20	10   1%     pv
    21	10   1%     groups
    22	9    0.9%   find
    23	8    0.8%   redshift
    24	8    0.8%   ping
    25	8    0.8%   mv
(Results vary with different Terminal windows on this one, having had them open for a while).

Acer Aspire One ES1, used mainly as a media server via the TV:

Code: Select all

brian@BG-Aspire-ES1-111M ~ $ 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 -n25
     1	264  38.3164%   sudo
     2	61   8.85341%   cd
     3	51   7.40203%   ls
     4	44   6.38607%   apt
     5	36   5.22496%   nano
     6	22   3.19303%   man
     7	22   3.19303%   inxi
     8	16   2.32221%   mkdir
     9	16   2.32221%   cat
    10	13   1.88679%   mount
    11	12   1.74165%   htop
    12	11   1.59652%   lsblk
    13	11   1.59652%   df
    14	7    1.01597%   wget
    15	7    1.01597%   redshift
    16	6    0.870827%  dd
    17	5    0.725689%  ping
    18	5    0.725689%  mkfs.fat
    19	5    0.725689%  lsusb
    20	5    0.725689%  dmesg
    21	4    0.580552%  showmount
    22	4    0.580552%  sensors
    23	4    0.580552%  reboot
    24	4    0.580552%  python
    25	3    0.435414%  rm
Acer Aspire One D255E (my on-the-go machine), fresh login over ssh so should be current:

Code: Select all

[brian@BG-D255E-MANJARO ~] $ 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 -n25
     1	91  19.7397%   sudo
     2	47  10.1952%   ls
     3	40  8.67679%   nano
     4	32  6.94143%   yaourt
     5	30  6.50759%   ssh
     6	30  6.50759%   cd
     7	27  5.85683%   scp
     8	23  4.98915%   pv
     9	23  4.98915%   cat
    10	13  2.81996%   man
    11	11  2.38612%   speedtest
    12	9   1.95228%   minicom
    13	7   1.51844%   cp
    14	6   1.30152%   ping
    15	6   1.30152%   groups
    16	6   1.30152%   git
    17	4   0.867679%  pinky
    18	4   0.867679%  lsblk
    19	4   0.867679%  diff
    20	3   0.650759%  wget
    21	3   0.650759%  pamac
    22	3   0.650759%  mv
    23	3   0.650759%  kquitapp5
    24	3   0.650759%  htop
    25	3   0.650759%  echo
and

Code: Select all

[brian@BG-D255E-MANJARO ~] $ history | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c | sort -n | tail | perl -lane 'print $F[1], "\t", $F[0], " ", "▄" x ($F[0] / 12)'
man	13 ▄
cat	23 ▄
pv	23 ▄
scp	27 ▄▄
cd	30 ▄▄
ssh	30 ▄▄
yaourt	32 ▄▄
nano	40 ▄▄▄
ls	47 ▄▄▄
sudo	91 ▄▄▄▄▄▄▄
(I'm surprised Pacman isn't in the top 25 .. maybe due to it being used with sudo).
:mrgreen:

I wonder if the scripts could be modified to filter sudo & return the second part (the command used with sudo)? It might better reflect usage.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Acer D255E 2GB - Manjaro KDE, LM17.3 KDE 32
Toshiba NB305 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

rene
Level 8
Level 8
Posts: 2228
Joined: Sun Mar 27, 2016 6:58 pm

Re: Which Linux terminal command do you use the most?

Post by rene » Wed Sep 05, 2018 9:28 pm

BG405 wrote:
Wed Sep 05, 2018 3:51 pm
I wonder if the scripts could be modified to filter sudo & return the second part (the command used with sudo)? It might better reflect usage.
Sure. This version does so (but keeps "sudo -s" and "sudo -i" as "sudo") and additionally combines both tabular and chart output types:

Code: Select all

history | awk '{ if ($2 != "sudo" || $3 == "-s" || $3 == "-i") cmd[$2]++; else cmd[$3]++; n++; } END { for (s in cmd) { printf("%d %d%% %s ",cmd[s],cmd[s]*100/n,s); for (i=0;i<cmd[s]/12;i++) printf("▄"); printf("\n") } }' | sort -nr | head -n10 | column -t | nl
For some reason the original filters out commands started from the current directory with "./" which seems not too useful but if someone insists: you can have awk does this itself as well by providing "^./" as a negative pattern:

Code: Select all

history | awk '$2!~/^.\// { if ($2 != "sudo" || $3 == "-s" || $3 == "-i") cmd[$2]++; else cmd[$3]++; n++; } END { for (s in cmd) { printf("%d %d%% %s ",cmd[s],cmd[s]*100/n,s); for (i=0;i<cmd[s]/12;i++) printf("▄"); printf("\n") } }' | sort -nr | head -n10 | column -t | nl
Output on a fairly newly installed, secondary system:

Code: Select all

     1	153  16%  ls    ▄▄▄▄▄▄▄▄▄▄▄▄▄
     2	92   9%   cat   ▄▄▄▄▄▄▄▄
     3	59   6%   man   ▄▄▄▄▄
     4	56   5%   ping  ▄▄▄▄▄
     5	55   5%   cd    ▄▄▄▄▄
     6	47   4%   apt   ▄▄▄▄
     7	42   4%   vim   ▄▄▄▄
     8	38   3%   ssh   ▄▄▄▄
     9	24   2%   rm    ▄▄
    10	21   2%   less  ▄▄

User avatar
BG405
Level 7
Level 7
Posts: 1551
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Which Linux terminal command do you use the most?

Post by BG405 » Wed Sep 05, 2018 10:23 pm

rene wrote:
Wed Sep 05, 2018 9:28 pm
Sure. This version does so (but keeps "sudo -s" and "sudo -i" as "sudo") and additionally combines both tabular and chart output types
Thanks! I might get the hang of this one day. Tried both versions, results below:

Code: Select all

[brian@BG-D255E-MANJARO ~] $ history | awk '{ if ($2 != "sudo" || $3 == "-s" || $3 == "-i") cmd[$2]++; else cmd[$3]++; n++; } END { for (s in cmd) { printf("%d %d%% %s ",cmd[s],cmd[s]*100/n,s); for (i=0;i<cmd[s]/12;i++) printf("▄"); printf("\n") } }' | sort -nr | head -n25 | column -t | nl
     1	47  10%  ls          ▄▄▄▄
     2	46  9%   nano        ▄▄▄▄
     3	32  6%   yaourt      ▄▄▄
     4	30  6%   ssh         ▄▄▄
     5	30  6%   cd          ▄▄▄
     6	28  6%   pacman      ▄▄▄
     7	27  5%   scp         ▄▄▄
     8	24  5%   pv          ▄▄
     9	23  4%   cat         ▄▄
    10	15  3%   mount       ▄▄
    11	13  2%   man         ▄▄
    12	11  2%   speedtest   ▄
    13	11  2%   cp          ▄
    14	9   1%   minicom     ▄
    15	7   1%   systemctl   ▄
    16	6   1%   umount      ▄
    17	6   1%   ping        ▄
    18	6   1%   mount.cifs  ▄
    19	6   1%   groups      ▄
    20	6   1%   git         ▄
    21	4   0%   pinky       ▄
    22	4   0%   mv          ▄
    23	4   0%   lsblk       ▄
    24	4   0%   history     ▄
    25	4   0%   diff        ▄

Code: Select all

[brian@BG-D255E-MANJARO ~] $ history | awk '$2!~/^.\// { if ($2 != "sudo" || $3 == "-s" || $3 == "-i") cmd[$2]++; else cmd[$3]++; n++; } END { for (s in cmd) { printf("%d %d%% %s ",cmd[s],cmd[s]*100/n,s); for (i=0;i<cmd[s]/12;i++) printf("▄"); printf("\n") } }' | sort -nr | head -n25 | column -t | nl
     1	47  10%  ls          ▄▄▄▄
     2	46  9%   nano        ▄▄▄▄
     3	32  6%   yaourt      ▄▄▄
     4	30  6%   ssh         ▄▄▄
     5	30  6%   cd          ▄▄▄
     6	28  6%   pacman      ▄▄▄
     7	27  5%   scp         ▄▄▄
     8	24  5%   pv          ▄▄
     9	23  4%   cat         ▄▄
    10	15  3%   mount       ▄▄
    11	13  2%   man         ▄▄
    12	11  2%   speedtest   ▄
    13	11  2%   cp          ▄
    14	9   1%   minicom     ▄
    15	7   1%   systemctl   ▄
    16	6   1%   umount      ▄
    17	6   1%   ping        ▄
    18	6   1%   mount.cifs  ▄
    19	6   1%   groups      ▄
    20	6   1%   git         ▄
    21	5   1%   history     ▄
    22	4   0%   pinky       ▄
    23	4   0%   mv          ▄
    24	4   0%   lsblk       ▄
    25	4   0%   diff        ▄
Note using these has bumped "history" to 1%. :D I altered them for 25 as I think this better reflects the most commonly used commands but that is just my opinion. 8)
Dell Inspiron 1525 - LM17.3 CE 64-------------------Acer D255E 2GB - Manjaro KDE, LM17.3 KDE 32
Toshiba NB305 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

rene
Level 8
Level 8
Posts: 2228
Joined: Sun Mar 27, 2016 6:58 pm

Re: Which Linux terminal command do you use the most?

Post by rene » Wed Sep 05, 2018 10:35 pm

BG405 wrote:
Wed Sep 05, 2018 10:23 pm
Note using these has bumped "history" to 1%. :D
That happened to me as well while testing, and in fact a bit over 1%. Upon noticing I decided to backup my ~/.bash_history so as to keep Heisenberg at bay -- and managed to fully delete the history when restoring, Hence the secondary system...

Note; that second one is the exact same save filtering out e.g. ./foo and ./bar same as the original does. Useful to a programmer I guess if constantly testing a just compiled ./foo but seemed to generally make too little sense to do as well. But yes, fun little thing.

rene
Level 8
Level 8
Posts: 2228
Joined: Sun Mar 27, 2016 6:58 pm

Re: Which Linux terminal command do you use the most?

Post by rene » Wed Sep 05, 2018 10:50 pm

Oh, wait, I have a recent backup. What a concept...

Code: Select all

$ history | awk '{ if ($2 != "sudo" || $3 == "-s" || $3 == "-i") cmd[$2]++; else cmd[$3]++; n++; } END { for (s in cmd) { printf("%d %d%% %s ",cmd[s],cmd[s]*100/n,s); for (i=0;i<cmd[s]/12;i++) printf("▄"); printf("\n") } }' | sort -nr | head -n10 | column -t | nl
     1	257  25%  ls    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
     2	101  10%  cd    ▄▄▄▄▄▄▄▄▄
     3	47   4%   cat   ▄▄▄▄
     4	44   4%   rm    ▄▄▄▄
     5	41   4%   less  ▄▄▄▄
     6	38   3%   man   ▄▄▄▄
     7	36   3%   apt   ▄▄▄
     8	29   2%   vim   ▄▄▄
     9	29   2%   mv    ▄▄▄
    10	20   2%   ping  ▄▄

User avatar
lsemmens
Level 6
Level 6
Posts: 1158
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Which Linux terminal command do you use the most?

Post by lsemmens » Thu Sep 06, 2018 7:50 am

1 2 33.3333% rm
2 1 16.6667% sudo
3 1 16.6667% last
4 1 16.6667% inxi
5 1 16.6667% history
leigh@leigh-lappy:~$
Kernel: 4.15.0-36-generic x86_64 bits: 64
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop T4500 Dualcore 4Gb RAM
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Linux Mint machines
Out of my mind - please leave a message

HaveaMint
Level 4
Level 4
Posts: 428
Joined: Fri Feb 02, 2018 9:56 pm
Location: Somewhere in the USA
Contact:

Re: Which Linux terminal command do you use the most?

Post by HaveaMint » Thu Sep 06, 2018 9:33 am

1 191 49.7397% &^%*#
2 47 10.1952% HELP!
3 40 8.67679% echo echo
4 32 6.94143% oops
5 30 6.50759% nooo
6 30 6.50759% where's that cd
7 27 5.85683% mint forums
8 23 4.98915% I didn't do nuttin
9 23 4.98915% sigh
10 13 2.81996% man
"Tune for maximum Smoke and then read the Instructions".

User avatar
snowflake
Level 2
Level 2
Posts: 62
Joined: Tue Jul 03, 2018 12:52 pm

Re: Which Linux terminal command do you use the most?

Post by snowflake » Thu Sep 06, 2018 9:59 am

heres how a noob's history looks like:

Code: Select all

     1	295  29.5%  sudo
     2	45   4.5%   python
     3	44   4.4%   xed
     4	42   4.2%   wget
     5	38   3.8%   echo
     6	33   3.3%   killall
     7	32   3.2%   mopidy
     8	22   2.2%   wine
     9	22   2.2%   flatpak
    10	21   2.1%   xinput
meh , disappointed, really thought I'm more interesting that this

rene
Level 8
Level 8
Posts: 2228
Joined: Sun Mar 27, 2016 6:58 pm

Re: Which Linux terminal command do you use the most?

Post by rene » Thu Sep 06, 2018 10:05 am

snowflake wrote:
Thu Sep 06, 2018 9:59 am
meh , disappointed, really thought I'm more interesting that this
Maybe there's all sorts of wild stuff hidden behind that sudo. If you take my above version,

Code: Select all

history | awk '{ if ($2 != "sudo" || $3 == "-s" || $3 == "-i") cmd[$2]++; else cmd[$3]++; n++; } END { for (s in cmd) { printf("%d %d%% %s ",cmd[s],cmd[s]*100/n,s); for (i=0;i<cmd[s]/12;i++) printf("▄"); printf("\n") } }' | sort -nr | head -n10 | column -t | nl
the programs executed with sudo will also show as themselves...

User avatar
BG405
Level 7
Level 7
Posts: 1551
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Which Linux terminal command do you use the most?

Post by BG405 » Fri Sep 07, 2018 9:11 pm

rene wrote:
Wed Sep 05, 2018 10:35 pm
That happened to me as well while testing, and in fact a bit over 1%. Upon noticing I decided to backup my ~/.bash_history so as to keep Heisenberg at bay -- and managed to fully delete the history when restoring, Hence the secondary system...
:shock: :oops:
I had a corrupted ~.bash_history on one machine. It was not cat friendly & that just won't do, so fixed it by making a backup & then finding and removing the non-standard character, think a cat may have introduced this. :roll:

Backups are certainly essential when messing with this sort of stuff! :mrgreen:

I'd be interested to find out how to filter out the display of the history result, which is affected by executing this, would help me to understand how this works .. will have to explore all this. I'm intrigued now. :)

HaveaMint wrote:
Thu Sep 06, 2018 9:33 am
1 191 49.7397% &^%*#
2 47 10.1952% HELP!
3 40 8.67679% echo echo
4 32 6.94143% oops
5 30 6.50759% nooo
6 30 6.50759% where's that cd
7 27 5.85683% mint forums
8 23 4.98915% I didn't do nuttin
9 23 4.98915% sigh
10 13 2.81996% man
:lol: :lol: :lol:
Dell Inspiron 1525 - LM17.3 CE 64-------------------Acer D255E 2GB - Manjaro KDE, LM17.3 KDE 32
Toshiba NB305 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

Post Reply

Return to “Chat about Linux”