foreword
- This article was tested under Ubuntu 20.04
View cache
fincore
See how big a single file is in the cache
fincore filename
Check how big all files in the directory are in the cache
ls ./ | xargs fincore
Recursively view the cache of all files in a directory
find ./ -type f | xargs fincore
vmtouch
See how big a single file is in the cache
vmtouch filename
Check how big all files in the directory are in the cache
vmtouch ./
pcstat
- Not tried, https://github.com/tobert/pcstat
hcache
- Not tried, https://github.com/silenceshell/hcache
This article is from qbit snap
Empty the cache
Just empty the PageCache
sync; echo 1 > /proc/sys/vm/drop_caches
Empty only dentries and inodes
sync; echo 2 > /proc/sys/vm/drop_caches
Also empty PageCache, dentries and inodes.
sync; echo 3 > /proc/sys/vm/drop_caches
This article is from qbit snap
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。