#TIL : Stats your top-10 frequently commands

Run this command, it will show top-10 frequently commands, explain shell

1
$ history | awk '{print $2}' | sort | uniq -c | sort -nr | head

Example result

1
2
3
4
5
6
7
8
9
10
2064 git
1284 ls
826 cd
700 ssh
602 clear
491 python
473 exit
341 vagrant
242 export
167 ping

#TIL : Commands

Command lsof

List all opened files, sockets, pipes

Eg:

  • List processes are using port 80 (need root if port between 1-1023)
1
# sudo lsof -i:80
  • List processes are using /bin/bash
1
# lsof /bin/bash