Using /proc/$PID/fd to understand where the files are written to.

/proc/$PID/fd provide a symbolic link to the file that the process $PID has open on the file descriptor NUM. One useful gain from this, is that I can use /proc/$PID/fd to understand where the files are written to.

% top

Let’s use Process 66090 (1508.exe)

% cd /proc/66090/fd
% ls -l
lr-x------ 1 user1 user1 64 Feb 15 12:41 0 -> /localhome/user1/scratch/G16c-Mistral909223.hpc-mn1/G16c-Mistral.Input.909223.hpc-mn1
l-wx------ 1 user1 user1 64 Feb 15 12:41 1 -> /localhome/user1/AgMPYH-GSH_4.gjf.Output.909223.hpc-mn1.log
lrwx------ 1 user1 user1 64 Feb 15 12:42 10 -> /localhome/user1/scratch/G16c-Mistral909223.hpc-mn1/Gau-66090.d2e
l-wx------ 1 user1 user1 64 Feb 15 12:41 129 -> /myhome/user1/breezetraces/user1-909223.hpc-mn1-hpc-g8004/tmp/monitor-command-fifo
lr-x------ 1 user1 user1 64 Feb 15 12:41 130 -> /proc/66090/mounts
lrwx------ 1 user1 user1 64 Feb 15 12:41 2 -> /var/spool/pbs/spool/909223.hpc-mn1.ER
lrwx------ 1 user1 user1 64 Feb 15 12:41 3 -> /localhome/user1/scratch/G16c-Mistral909223.hpc-mn1/Gau-66081.inp
lrwx------ 1 user1 user1 64 Feb 15 12:41 4 -> socket:[75030280]
lrwx------ 1 user1 user1 64 Feb 15 12:41 5 -> socket:[75030281]
lrwx------ 1 user1 user1 64 Feb 15 12:42 6 -> /localhome/user1/scratch/G16c-Mistral909223.hpc-mn1/Gau-66090.rwf
lrwx------ 1 user1 user1 64 Feb 15 12:42 7 -> /localhome/user1/AgMPYH-GSH_4.chk
lrwx------ 1 user1 user1 64 Feb 15 12:42 8 -> /localhome/user1/scratch/G16c-Mistral909223.hpc-mn1/Gau-66090.skr
lrwx------ 1 user1 user1 64 Feb 15 12:42 9 -> /localhome/user1/scratch/G16c-Mistral909223.hpc-mn1/Gau-66090.int

You can see for most of the user processes, it is written to /localhome/user1.