首页 > 系统服务 > 详细

shell习题第19题:最常用的命令

时间:2019-06-08 18:12:51      阅读:86      评论:0      收藏:0      [点我收藏+]

【题目要求】

查看使用最多的10个命令

【核心要点】

history 或者 ~/.bash_history

sort uniq

【脚本】

#!/bin/bash

# history就是调用cat ~/.bash_history

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

 

shell习题第19题:最常用的命令

原文:https://www.cnblogs.com/dingzp/p/10991105.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!