Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

List 10 most often used commands

Answer:

You can list the top 10 most often used commands in your Linux, by the following method.

# history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head 

135 ls
63 cd
48 exit
46 sudo
34 tail
30 cat
29 df
18 date
17 vi
12 pwd
  1. Search the history of commands you have executed
  2. List file by date
  3. How to run multiple commands at once in Linux?
  4. How to combine the output of multiple commands into a single file?
  5. List the size of sub directories in the current directory

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>