使用hcache查看使用buff/cache的目录文件

简介: 我是使用的git从github拉取下代码,然后重新编译的, 因为此项目是go语言写的,所以编译时需要安装go语言如下命令下载代码,或者直接下载zip压缩包,资源在 “此目录下文档中所用的资源” 目录中

使用hcache查看使用buff/cache的目录文件

我是使用的git从github拉取下代码,然后重新编译的, 因为此项目是go语言写的,所以编译时需要安装go语言

如下命令下载代码,或者直接下载zip压缩包,资源在 “此目录下文档中所用的资源” 目录中

git clone git@github.com:silenceshell/hcache.git
AI 代码解读

进入主目录,编译,然后将编译后的文件拷贝到/usr/local/bin目录下,即可使用

cd hcache
make build
sudo cp hcache /usr/local/bin/
AI 代码解读

使用:

hcache <-json <-pps>|-terse|-default> <-nohdr> <-bname> file file file
 -json output will be JSON
   -pps include the per-page information in the output (can be huge!)
 -terse print terse machine-parseable output
 -default print ascii tables
 -histo print a histogram using unicode block characters
 -nohdr don't print the column header in terse or default format
 -bname use basename(file) in the output (use for long paths)
 -plain return data with no box characters
 -unicode return data with unicode box characters
 -pid int show all open maps for the given pid
 -top int show top x cached files
AI 代码解读
$ hcache --top 10
[sudo] password for silenceshell: 
+----------------------------------------------------------------------------------+----------------+------------+-----------+---------+
| Name                                                                             | Size (bytes)   | Pages      | Cached    | Percent |
|----------------------------------------------------------------------------------+----------------+------------+-----------+---------|
| /opt/google/chrome/chrome                                                        | 114911208      | 28055      | 25457     | 090.740 |
| /usr/share/code/code                                                             | 67688720       | 16526      | 12274     | 074.271 |
| /home/silenceshell/Software/pycharm-community-2016.2/lib/pycharm.jar                   | 95177431       | 23237      | 11325     | 048.737 |
| /opt/atom/atom                                                                   | 62641344       | 15294      | 10578     | 069.164 |
| /usr/bin/dockerd                                                                 | 39121168       | 9552       | 7103      | 074.361 |
| /home/silenceshell/Software/pycharm-community-2016.2/jre/jre/lib/amd64/libjfxwebkit.so | 57455824       | 14028      | 6625      | 047.227 |
| /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4.10.2                                  | 36462184       | 8902       | 6316      | 070.950 |
| /usr/lib/beyondcompare/BCompare                                                  | 30640160       | 7481       | 5505      | 073.586 |
| /usr/bin/SecureCRT                                                               | 29524560       | 7209       | 4806      | 066.667 |
| /usr/share/code/libnode.so                                                       | 21135976       | 5161       | 4588      | 088.898 |
+----------------------------------------------------------------------------------+----------------+------------+-----------+---------+
$ 
$ hcache --top 3  --bname  
+-------------+----------------+------------+-----------+---------+
| Name        | Size (bytes)   | Pages      | Cached    | Percent |
|-------------+----------------+------------+-----------+---------|
| chrome      | 114911208      | 28055      | 25476     | 090.807 |
| pycharm.jar | 95177431       | 23237      | 11479     | 049.400 |
| atom        | 62641344       | 15294      | 10578     | 069.164 |
+-------------+----------------+------------+-----------+---------+ 
$ 
$ lsof /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4.10.2 
COMMAND    PID   USER  FD   TYPE DEVICE SIZE/OFF    NODE NAME
quiterss 20630 silenceshell mem    REG    8,5 36462184 3936610 /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4.10.2
AI 代码解读

根据上面github给的示例,我们可以发现常用的两个命令为:

在root用户下使用:

1.显示top n的缓存目录

hcache --top 10
AI 代码解读

2.显示top n 的缓存目录的基本信息,包括大小

hcache --top 3  --bname
AI 代码解读
目录
打赏
0
0
0
0
20
分享
相关文章
【计算巢】幻兽帕鲁服务器如何设置定时备份存档
计算巢针对幻兽帕鲁服务器,提供给了定时备份存档的功能,会在设定的频率下,定时将存档文件备份到目标文件夹下,有助于解决存档丢失和坏档的问题。
【帕鲁更新攻略】如何快速在阿里云上更新游戏服务端版本
幻兽帕鲁游戏服务端版本升级后,需要玩家同步更新才能继续游戏,您可以按照以下操作完成游戏服务端升级。
49289 840
【帕鲁更新攻略】如何快速在阿里云上更新游戏服务端版本
linux系统中buff/cache占用过高?不明白为何过高?
linux系统中buff/cache占用过高?不明白为何过高?
2761 1
三分钟磁盘存储性能IOPS、I/O及吞吐量指标详解
什么是磁盘I/O?存储IOPS是什么?磁盘性能指标吞吐量是指什么?
16908 39

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问