How to find who occupied disk space
- du -h -x --max-depth=1 # x: skip directories on different file systems
- lsof # if file was deleted, but still opened.
- lsof | grep '(deleted)' | sort | uniq
- COMMAND PID TID USER FD TYPE DEVICE SIZE/OFF NODE NAME
- how to undelete a file
- cp /proc/pid/fd/fd_no file
- 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
- LINUX : strings –a /proc/<pid_of_the_process>/environ
- Solaris pargs -e <pid_of_the_process>
- AIX pargs or ps eww <pid_of_the_process>