If you are on Linux, and I read your question correctly, yes look in /proc
.
For a specific process look in /proc/[pid]/fd
, e.g. ls -l /proc/123/fd/
There is also a special way to reach current process fd's by: /proc/self/fd
.
Note that e.g. ls -l /proc/self/fd
would be for the ls
process and not for
your current shell, which you can see by:
cat /proc/self/cmdline | tr '\000' '\n'
or
cat /proc/self/status
For the last look especially at PPid
which should be PID of your shell.
Name: cat
State: R (running)
Tgid: 12696
Pid: 12696
PPid: 312
As an experiment you could try to open two terminal windows:
- In window 1 enter
echo $$
to get PID of that shell.
- In window 2 say
cat /proc/[pid]/fd/1
- In window 1 start typing and observe what happens in window 2.
1> stdout.txt
(or, more commonly, just> stdout.txt
), you should get a file calledstdout.txt
in the current directory. If the file can't be opened in the current directory (permission problem or some other error), you should get an error message informing you of this.stdout.txt
in the current directory. It doesn't matter what type of filesystemstdout.txt
lives on.stdout.txt
, which the command creates.