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

Detailed explanation of Truncate usage in MYSQL

This article guide: There are two ways to delete ...

Summary of the use of Datetime and Timestamp in MySQL

Table of contents 1. How to represent the current...

Sample code for implementing neon button animation effects with CSS3.0

Today I will share with you a neon button animati...

Detailed explanation of views in MySQL

view: Views in MySQL have many similarities with ...

Some questions about hyperlinks

I am very happy to attend this episode of potato ...

The textarea tag cannot be resized and cannot be dragged with the mouse

The textarea tag size is immutable Copy code The c...

In-depth study of vue2.x--Explanation of the h function

Table of contents Solution, Summarize: vue projec...

How to hide a certain text in HTML?

Text hiding code, hide a certain text in HTML Copy...

MySQL series 6 users and authorization

Table of contents Tutorial Series 1. User Managem...

Solution to span width not being determined in Firefox or IE

Copy code The code is as follows: <html xmlns=...

Design and implementation of Vue cascading drop-down box

Table of contents 1. Database design 2. Front-end...

Detailed explanation of the correct way to install opencv on ubuntu

This article describes how to install opencv with...

MySQL helps you understand index pushdown in seconds

Table of contents 1. The principle of index push-...