Scripts Stats

6 min read Original article ↗

I have grown many scripts in my UNIX life – close to 500 that I still use daily and even more then 700 in my 18 years time at various jobs … and also often for personal daily reasons.

% find ~/scripts -maxdepth 1 | wc -l
     492

% find ~/scripts -type f | wc -l
     702

All (or most) of these scripts are available on my https://github.com/vermaden/scripts GitHub page.

Feel free to ask me about ones I did not added there.

… and while having all of them – I was curious … how often I use them.

Are they still useful? Should I delete them? Phase out? Archive?

There was time that You probably seen the following code part in some of my scripts.

echo '1' 2> /dev/null >> ~/scripts/stats/${0##*/}

It is/was for stats.

I have created a ~/scripts/stats directory in which I stored stats for how often I executed my scripts … and gathered these stats for 3 years.

The start date of the experiment was on 2020/10/17 day.

To be honest – the code snipped should have looked like that one below – to make sure its possible to store the stats and the dir exists 🙂

mkdir -p                 ~/scripts/stats || exit 0
echo '1' 2> /dev/null >> ~/scripts/stats/${0##*/}

The complete stats are below – but be advised that they contain various scripts I run using cron(8) or that they are part of my 5 minutes or less Dzen2 information bar.

5800969  TOTAL
1074619  desktop-kill-shit.sh
 506653  __conky_if_dns.sh
 506485  __conky_if_ping.sh
 506466  __conky_if_gw.sh
 506357  dzen2-update.sh
 499821  __conky_if_ip.sh
 493590  __conky_battery_separate.sh
 484046  desktop-battery-warning.sh
 363833  __conky_if_xfer.sh
 207484  rsync-delete.sh
 132050  acpi-thinkpad-fan.sh
 155405  random-wallpaper.sh
  94059  rsync-delete-before.sh
  42239  xdotool.sh
  41625  to-ascii.sh
  37234  random.sh
  25154  xterm.sh
  20593  random-wallpaper-always.sh
  12811  __conky_battery.sh
  11162  todo.sh
  11135  cal.sh
   8634  network.sh
   6303  mpv.sh
   6249  ff.mp3.320.sh
   6017  mupdf.sh
   4771  see.sh
   3565  shot.sh
   2977  __openbox_lock.sh
   2034  urxvt.sh
   2024  aero-snap.sh
   1702  terminal.sh
   1236  desktop-debug.sh
   1082  photo-unsharp-mask-JPG.sh
   1073  dzen2-fifo.sh
   1073  __openbox_restart_dzen2.sh
   1072  __openbox_restart_tint2.sh
    788  thunar-mass-rename.sh
    741  __openbox_freebsd_sound.sh
    724  __openbox_lock_zzz.sh
    694  generate-links.sh
    683  __openbox_cpufreq_dynamic.sh
    682  __openbox_delete_wallpaper.sh
    655  __openbox_restart_conky.sh
    637  backup-cfg.sh
    620  photo-movie-audio-ac3.sh
    508  __openbox_virtualbox.sh
    503  to-lower.sh
    483  desktop-pause.sh
    468  __openbox_clean_tmp.sh
    460  ncdu.sh
    434  __openbox_cpufreq.sh
    420  firefox.sh
    384  rsync-delete-checksum.sh
    377  nfs.sh
    365  __openbox_edit_screenshot.sh
    342  games-sensible-world-of-soccer-SFX.sh
    322  sumatra.sh
    291  mdconfig.sh
    286  __openbox_dmenu.sh
    285  __random.sh
    284  mouse-move.sh
    277  photo-movie-audio-copy.sh
    272  mp3-EYE3D-remove-id.sh
    231  photo-movie-audio-copy-x265.sh
    226  __openbox_restart_redshift.sh
    208  __openbox_edit_wallpaper_gimp.sh
    205  __openbox_show_screenshot.sh
    188  __openbox_current_wallpaper.sh
    184  mpv-shuffle.sh
    183  __openbox_trash_delete.sh
    182  games-baldurs-gate-II-ee-fullscreen.sh
    162  __openbox_phaseout_wallpaper.sh
    161  files-count.sh
    152  photo-movie-half-audio-copy-x265.sh
    142  rsync.sh
    142  pdf-split.sh
    135  rdesktop-mine.sh
    135  pdf-pts-scale.sh
    135  __openbox_restart_plank.sh
    118  to-ascii-all.sh
    102  battery-capacity.sh
     93  __openbox_reload_wallpaper.sh
     89  jhead.sh
     86  tile.sh
     77  photo-requality.sh
     74  photo-rename-images.sh
     68  zip.sh
     68  pdf-concat.sh
     66  colors.sh
     65  games-baldurs-gate-I-ee-fullscreen.sh
     64  thunar.sh
     57  smartwear.sh
     57  photo-rename-movies.sh
     53  tcpkill.sh
     53  fastdiff.sh
     49  __openbox_restart_compton.sh
     48  pkg-recompile.sh
     47  sensors.sh
     45  vbox-suid.sh
     45  __openbox_restart_xbindkeys.sh
     42  games-baldurs-gate-I-fullscreen.sh
     41  contacts-convert-vcf-from.sh
     40  games-baldurs-gate-I-ee-window.sh
     40  contacts-check.sh
     38  dedup.sh
     36  pdf-extract.sh
     35  photo-unsharp-mask-PNG.sh
     35  games-colin-mcrae-rally-2.0-window.sh
     32  files-big.sh
     32  epiphany.sh
     31  photo-flow.sh
     31  backup-remote-checksum.sh
     30  loop.sh
     30  firefox-clean.sh
     27  idle.sh
     24  games-icewind-dale-ee-fullscreen.sh
     23  games-sensible-world-of-soccer.sh
     23  games-heroes-of-might-and-magic-III-window.sh
     22  fc-cache.sh
     20  xnview.sh
     20  __openbox_stop_compton.sh
     19  key.sh
     18  winscp.sh
     18  games-heroes-of-might-and-magic-III-HotA-window.sh
     18  __openbox_restart_squid.sh
     17  ports-generate-distinfo.sh
     17  games-swing.sh
     16  games-diablo.sh
     15  games-baldurs-gate-II-ee-window.sh
     15  backup-sys.sh
     11  pdf-rotate-right.sh
     11  games-DOSBOX.sh
     10  nfs-clean.sh
     10  http.sh
     10  games-pro-pinball-timeshock-window.sh
     10  games-lionheart-window.sh
      9  games-heroes-of-might-and-magic-III-HotA-fullscreen.sh
      9  ff.mp3.160.sh
      9  contacts-convert-vcf-to.sh
      9  __xterm_link_open.sh
      8  sshfs.sh
      8  lsblk.sh
      8  html-strip-script.sh
      8  games-fallout-2-window.sh
      8  games-fallout-2-fullscreen.sh
      8  games-canyon-defence.sh
      8  games-all-terrain-racing.sh
      8  __openbox_monitor_off_auto.sh
      7  games-sensible-world-of-soccer-UPG.sh
      7  games-pinball-space-cadet-NATIVE.sh
      6  rdesktop_1800_1000.sh
      6  netstat.sh
      6  games-colin-mcrae-rally-2.0-fullscreen.sh
      6  games-baldurs-gate-I-window.sh
      6  __openbox_virtualbox_vmctrl.sh
      6  __openbox_stop_plank.sh
      6  __openbox_stats_top_cpu_RENICE.sh
      6  __openbox_stats_ps_KILLALL.sh
      5  vergallery.sh
      5  rsync-delete-linux.sh
      5  games-worms-armageddon-fullscreen.sh
      5  games-robokill-1.sh
      5  games-heroes-of-might-and-magic-II.sh
      5  freebsd-lists.sh
      5  detox.sh
      5  __openbox_virtualbox_reload.sh
      5  __openbox_stats_top_cpu_KILL.sh
      5  __conky_top.sh
      4  wm_names.sh
      4  photo-movie-half-audio-copy-x264.sh
      4  photo-movie-audio-ac3-CRF.sh
      4  gg-log.sh
      4  games-sensible-golf.sh
      4  games-robokill-2.sh
      4  games-pinball-short-circuit.sh
      4  games-lionheart-fullscreen.sh
      4  __xterm_set_title.sh
      4  __openbox_stop_dzen2.sh
      4  __openbox_stats_top_mem_RENICE.sh
      3  see-open.sh
      3  photo-FLOW.sh
      3  jail.sh
      3  jail-version.sh
      3  games-theme-hospital.sh
      3  games-supercars-international.sh
      3  games-governor-of-poker.sh
      3  games-carmageddon.sh
      3  ext-maxtor.sh
      3  __openbox_stop_tint2.sh
      3  __openbox_stats_top_mem_KILL.sh

The same list without the stuff that runs periodically in cron(8) is below.

235624  TOTAL
 42239  xdotool.sh
 41625  to-ascii.sh
 37234  random.sh
 25154  xterm.sh
 11162  todo.sh
 11135  cal.sh
  8634  network.sh
  6303  mpv.sh
  6249  ff.mp3.320.sh
  6017  mupdf.sh
  4771  see.sh
  3565  shot.sh
  2977  __openbox_lock.sh
  2034  urxvt.sh
  2024  aero-snap.sh
  1702  terminal.sh
  1236  desktop-debug.sh
  1082  photo-unsharp-mask-JPG.sh
  1073  __openbox_restart_dzen2.sh
  1072  __openbox_restart_tint2.sh
   788  thunar-mass-rename.sh
   741  __openbox_freebsd_sound.sh
   724  __openbox_lock_zzz.sh
   694  generate-links.sh
   683  __openbox_cpufreq_dynamic.sh
   682  __openbox_delete_wallpaper.sh
   655  __openbox_restart_conky.sh
   637  backup-cfg.sh
   620  photo-movie-audio-ac3.sh
   508  __openbox_virtualbox.sh
   503  to-lower.sh
   483  desktop-pause.sh
   468  __openbox_clean_tmp.sh
   460  ncdu.sh
   434  __openbox_cpufreq.sh
   420  firefox.sh
   384  rsync-delete-checksum.sh
   377  nfs.sh
   365  __openbox_edit_screenshot.sh
   342  games-sensible-world-of-soccer-SFX.sh
   322  sumatra.sh
   291  mdconfig.sh
   286  __openbox_dmenu.sh
   285  __random.sh
   284  mouse-move.sh
   277  photo-movie-audio-copy.sh
   272  mp3-EYE3D-remove-id.sh
   231  photo-movie-audio-copy-x265.sh
   226  __openbox_restart_redshift.sh
   208  __openbox_edit_wallpaper_gimp.sh
   205  __openbox_show_screenshot.sh
   188  __openbox_current_wallpaper.sh
   184  mpv-shuffle.sh
   183  __openbox_trash_delete.sh
   182  games-baldurs-gate-II-ee-fullscreen.sh
   162  __openbox_phaseout_wallpaper.sh
   161  files-count.sh
   152  photo-movie-half-audio-copy-x265.sh
   142  rsync.sh
   142  pdf-split.sh
   135  rdesktop-mine.sh
   135  pdf-pts-scale.sh
   135  __openbox_restart_plank.sh
   118  to-ascii-all.sh
   102  battery-capacity.sh
    93  __openbox_reload_wallpaper.sh
    89  jhead.sh
    86  tile.sh
    77  photo-requality.sh
    74  photo-rename-images.sh
    68  zip.sh
    68  pdf-concat.sh
    66  colors.sh
    65  games-baldurs-gate-I-ee-fullscreen.sh
    64  thunar.sh
    57  smartwear.sh
    57  photo-rename-movies.sh
    53  tcpkill.sh
    53  fastdiff.sh
    49  __openbox_restart_compton.sh
    48  pkg-recompile.sh
    47  sensors.sh
    45  vbox-suid.sh
    45  __openbox_restart_xbindkeys.sh
    42  games-baldurs-gate-I-fullscreen.sh
    41  contacts-convert-vcf-from.sh
    40  games-baldurs-gate-I-ee-window.sh
    40  contacts-check.sh
    38  dedup.sh
    36  pdf-extract.sh
    35  photo-unsharp-mask-PNG.sh
    35  games-colin-mcrae-rally-2.0-window.sh
    32  files-big.sh
    32  epiphany.sh
    31  photo-flow.sh
    31  backup-remote-checksum.sh
    30  loop.sh
    30  firefox-clean.sh
    27  idle.sh
    24  games-icewind-dale-ee-fullscreen.sh
    23  games-sensible-world-of-soccer.sh
    23  games-heroes-of-might-and-magic-III-window.sh
    22  fc-cache.sh
    20  xnview.sh
    20  __openbox_stop_compton.sh
    19  key.sh
    18  winscp.sh
    18  games-heroes-of-might-and-magic-III-HotA-window.sh
    18  __openbox_restart_squid.sh
    17  ports-generate-distinfo.sh
    17  games-swing.sh
    16  games-diablo.sh
    15  games-baldurs-gate-II-ee-window.sh
    15  backup-sys.sh
    11  pdf-rotate-right.sh
    11  games-DOSBOX.sh
    10  nfs-clean.sh
    10  http.sh
    10  games-pro-pinball-timeshock-window.sh
    10  games-lionheart-window.sh
     9  games-heroes-of-might-and-magic-III-HotA-fullscreen.sh
     9  ff.mp3.160.sh
     9  contacts-convert-vcf-to.sh
     9  __xterm_link_open.sh
     8  sshfs.sh
     8  lsblk.sh
     8  html-strip-script.sh
     8  games-fallout-2-window.sh
     8  games-fallout-2-fullscreen.sh
     8  games-canyon-defence.sh
     8  games-all-terrain-racing.sh
     8  __openbox_monitor_off_auto.sh
     7  games-sensible-world-of-soccer-UPG.sh
     7  games-pinball-space-cadet-NATIVE.sh
     6  rdesktop_1800_1000.sh
     6  netstat.sh
     6  games-colin-mcrae-rally-2.0-fullscreen.sh
     6  games-baldurs-gate-I-window.sh
     6  __openbox_virtualbox_vmctrl.sh
     6  __openbox_stop_plank.sh
     6  __openbox_stats_top_cpu_RENICE.sh
     6  __openbox_stats_ps_KILLALL.sh
     5  vergallery.sh
     5  rsync-delete-linux.sh
     5  games-worms-armageddon-fullscreen.sh
     5  games-robokill-1.sh
     5  games-heroes-of-might-and-magic-II.sh
     5  freebsd-lists.sh
     5  detox.sh
     5  __openbox_virtualbox_reload.sh
     5  __openbox_stats_top_cpu_KILL.sh
     5  __conky_top.sh
     4  wm_names.sh
     4  photo-movie-half-audio-copy-x264.sh
     4  photo-movie-audio-ac3-CRF.sh
     4  gg-log.sh
     4  games-sensible-golf.sh
     4  games-robokill-2.sh
     4  games-pinball-short-circuit.sh
     4  games-lionheart-fullscreen.sh
     4  __xterm_set_title.sh
     4  __openbox_stop_dzen2.sh
     4  __openbox_stats_top_mem_RENICE.sh
     3  see-open.sh
     3  photo-FLOW.sh
     3  jail.sh
     3  jail-version.sh
     3  games-theme-hospital.sh
     3  games-supercars-international.sh
     3  games-governor-of-poker.sh
     3  games-carmageddon.sh
     3  ext-maxtor.sh
     3  __openbox_stop_tint2.sh
     3  __openbox_stats_top_mem_KILL.sh

The experiment ended on 2023/10/17.

This is the time I removed the known code snipped from all of the scripts.

This data helped me to tweak a little more the ones that I use the most … and especially the ones that are run by my Dzen2 info bar config or in cron(8) daemon.

Some of this input also helped me to just phase out the ones that are not needed anymore … to put them into retirement.

EOF