title: Check if a already running process has the stdin redirected on Linux?
body: <p>Given the PID of a process, is there a way to find out if this process has the stdin or stdout redirected?</p>
  
  <p>I have one application that reads from the stdin. For convenience, I usually launch this application with stdin redirected from file, like this:</p>
  
  <p><code>app &lt; input1.txt</code></p>
  
  <p>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?</p>
  
  <p>Using <code>ps -aux | grep PID</code> allow me to see the command line used. But does not give me any information about the <code>stdin</code> or <code>stdout</code>. </p>
  
  <p>I have also tried to look in <code>top</code>, as well as in <code>/proc/PID/*</code> but haven't found anything.</p>
  
  <p>I am using CentOS 7, if that helps.</p>