丁祖平

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

【题目要求】

查看使用最多的10个命令

【核心要点】

history 或者 ~/.bash_history

sort uniq

【脚本】

#!/bin/bash

# history就是调用cat ~/.bash_history

cat ~/.bash_history | sort | uniq -c | sort -nr | head -n 1

 

posted on 2019-06-08 16:58  丁祖平  阅读(89)  评论(0编辑  收藏  举报