crash命令 —— files


参考: https://crash-utility.github.io/help_pages/files.html

用法:

  • 查看进程当前打开的文件的信息,被打开的文件的file,dentry以及inode
    files
    或者
    files <进程task_struct>

  • 根据dentry的地址查看它对应的inode、超级块、文件类型以及路径
    files -d

  • 根据inode的地址查看这个inode下面的所有页缓存
    files -p

  • 查看进程打开的文件对应的fd、inode以及inode的i_mapping成员、pagecache中的页面数、文件类型和路径
    files -c

  • 在文件打开的文件信息中搜索指定的内容,比如文件名,inode地址,地址空间、file地址等等

在指定的进程中搜索: files -R hello
在所有进程中搜索:foreach files -R hello