TIL #6: Top 10 Commands That You Use On Your Command-line Terminal

I found a command that you can use to list down top commands that you use in your terminal

$ 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

Following is my list

     1  1244  12.4412%   cd
     2  1056  10.5611%   git
     3  827   8.27083%   docker
     4  575   5.75058%   ls
     5  523   5.23052%   gdw
     6  447   4.47045%   docker-compose
     7  378   3.78038%   pass
     8  221   2.21022%   gs
     9  187   1.87019%   open
    10  184   1.84018%   rm

gdw is shortcut for Gradle wrapper.

Talk: Container Performance Analysis

Today, I watched DockerCon 2017 talk on Container Performance Analysis. Talk is given by Brendan Gregg, Senior Performance Architect at Netflix. In his talk, he shares various linux tools that can help you understand performance of your container platform. It is a great talk for anyone trying to do performance analysis of containers. In one of his slides, he shared 10 tools that he will use to start the investigation.

  1. uptime to check load averages
  2. dmesg | tail  to check kernel errors
  3. vmstat 1 to see overall stats by time
  4. mpstat -P ALL 1 to check CPU balance
  5. pidstat 1 to check process usage
  6. iostat -xz 1 to disk I/O
  7. free -m to check memory usage
  8. sar -n DEV 1 to check network I/O
  9. sar -n TCP, ETCP 1 to view TCP stats
  10. top for overview

Read More »