How to find who occupied disk space

17 篇文章 0 订阅
4 篇文章 0 订阅

How to find who occupied disk space

 

  1. du -h -x --max-depth=1 # x: skip directories on different file systems
  2. lsof # if file was deleted, but still opened.
    • lsof | grep '(deleted)' | sort | uniq
    • COMMAND     PID   TID           USER   FD      TYPE             DEVICE    SIZE/OFF       NODE NAME
  3. how to undelete a file
    • cp /proc/pid/fd/fd_no file
  4. how to find the info about a process
    • ls -l /proc/PID
    • cwd符号链接的是进程运行目录;
    • exe符号连接就是执行程序的绝对路径;
    • cmdline就是程序运行时输入的命令行命令;
    • environ记录了进程运行时的环境变量;
    • fd目录下是进程打开或使用的文件的符号连接。

How To Check Environment Variables for a Running Process

  1. LINUX :  strings –a /proc/<pid_of_the_process>/environ
  2. Solaris  pargs -e <pid_of_the_process>
  3. AIX  pargs or ps eww <pid_of_the_process>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值