Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$ ls -l /dev/stdin /dev/fd/0
lrwx------ 1 tim tim 64 2011-08-07 09:53 /dev/fd/0 -> /dev/pts/2
lrwxrwxrwx 1 root root 15 2011-08-06 08:14 /dev/stdin -> /proc/self/fd/0
$ ls -l /dev/pts/2 /proc/self/fd/0
crw--w---- 1 tim tty  136, 2 2011-08-07 09:54 /dev/pts/2
lrwx------ 1 tim tim     64 2011-08-07 09:54 /proc/self/fd/0 -> /dev/pts/2
  1. What differences and relations are between /dev/fd/ and /proc/self/fd/? Do the two fd's mean both floppy disk, both file descriptor, or one for each?
  2. What are /proc/self and /proc usually for?
share|improve this question
up vote 7 down vote accepted

/dev/fd and /proc/self/fd are exactly the same; /dev/fd is a symbolic link to /proc/self/fd. /proc/self/fd is part of a larger scheme that exposes the file descriptor of all processes (/proc/$pid/fd/$number). /dev/fd exists on other unices and is provided under Linux for compatibility. /proc/*/fd is specific to Linux.

share|improve this answer

They mean file descriptor in each case. Look at my answer to the second part of your question about /dev/ files. And also what file descriptors are.

The /proc filesystem is described here. /proc/self contains the properties of the current process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.