Given the PID of a process, is there a way to find out if this process has the stdin or stdout redirected?
I have one application that reads from the stdin. For convenience, I usually launch this application with stdin redirected from file, like this:
app < input1.txt
The problem is that sometimes I launch the application and forget what was the input file that I used. Is there a way to find out which file has been used to redirect the stdin?
Using ps -aux | grep PID
allow me to see the command line used. But does not give me any information about the stdin
or stdout
.
I have also tried to look in top
, as well as in /proc/PID/*
but haven't found anything.
I am using CentOS 7, if that helps.