注:部分内容来自书籍或者网络,如有侵权,请联系删除。
#!/usr/bin/python
# -*- coding:UTF-8 -*-
import os
from collections import Counter
c = Counter()
with open(os.path.expanduser('~/.bash_history')) as f:
for line in f:
cmd = line.strip().split()
if cmd:
c[cmd[0]]+=1
print(c.most_common(10))
「 文章如果对你有帮助,请点个赞哦^^ 」 
1+
若无特殊注明,文章均为本站原创或整理发布。
转载请注明本文地址:https://om.fangxiaoxiong.com/2729.html