Get a list of your top 10 most frequently used terminal commands in Linux

Get a list of your top 10 most frequently used terminal commands in Linux

I think the commands I use most often are:

  1. Choices
  2. cd
  3. git
  4. ls
  5. ssh
  6. sudo

A few weeks ago I stumbled across this Reddit thread where a short Bash snippet showed me how to get a list of my most used Terminal commands.

history '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' column

The details aren't super important, but basically, it takes the output of your history commands, summarizes it, and tells you what the top ten commands were, and what percentage of time each command used. You could easily make some modifications to the snippet to get a longer list, or change the formatting slightly. This is from my recently updated laptop.

  1 138 25.0909% sudo
  2 59 10.7273% ls
  3 47 8.54545% cd
  4 20 3.63636% git
  5 19 3.45455% grep
  6 13 2.36364% vi
  7 10 1.81818% lpstat
  8 9 1.63636% find
  9 8 1.45455% ps
 10 8 1.45455% htop

The only one of these that surprised me was lpstat (I've been struggling with printer configuration lately). These numbers aren't huge, and some of the details are hidden behind sudo (most likely a lot of them are DNF updates). Curiously, I ran the same command on my desktop and on several virtual machines that were used for different purposes and got very different results.

On my desktop, I spend a fair amount of time using ssh. Among virtual machines, systemctl and docker both made the list, with vi jumping to the top as I spend a lot of time editing configuration files.

Your top ten probably shared something about you, too. Are you a developer? A super user? Do you use remote systems often? What is your favorite text editor?
If you like, feel free to share your top ten, or the best tools for doing so. Did your list surprise you? Is it the same as you think?

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Commands to find domain IP address in Linux terminal (five methods)
  • Detailed explanation of how to use socks5 proxy for Linux terminal
  • Android's implementation method of executing shell scripts in the Linux terminal to directly print the log of the currently running app
  • How to use Shell script to get terminal width in Linux
  • Two tools for splitting the screen in the Linux command line terminal
  • Two methods of terminal split screen under Linux (screen and tmux)
  • Detailed explanation of commonly used shortcut keys for Linux terminal command line
  • How to exit the Python command line in the Linux terminal
  • Linux uses stty to display and modify terminal line settings

<<:  How to visualize sketched charts in Vue.js using RoughViz

>>:  How to add and delete unique indexes for fields in MySQL

Recommend

Implementation code for adding slash to Vue element header

<template> <div class="app-containe...

Implementation of nginx proxy port 80 to port 443

The nginx.conf configuration file is as follows u...

In-depth explanation of the locking mechanism in MySQL

Preface In order to ensure the consistency and in...

JavaScript Sandbox Exploration

Table of contents 1. Scenario 2. Basic functions ...

Detailed explanation of the new CSS display:box property

1. display:box; Setting this property on an eleme...

6 interesting tips for setting CSS background images

Background-image is probably one of those CSS pro...

Realize map aggregation and scattering effects based on vue+openlayer

Table of contents Preface: Result: 1. Polymerizat...

Delegating Privileges in Linux Using Sudo

Introduction to sudo authority delegation su swit...

How to express relative paths in Linux

For example, if your current path is /var/log and...

JavaScript String Object Methods

Table of contents Methods of String Object Method...

MySQL 8.x msi version installation tutorial with pictures and text

1. Download MySQL Official website download addre...

jQuery realizes the sliding effect of drop-down menu

When we make a web page, sometimes we want to hav...

Detailed explanation of how to create MySql scheduled tasks in navicat

Detailed explanation of creating MySql scheduled ...

Detailed analysis of classic JavaScript recursion case questions

Table of contents What is recursion and how does ...