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>