The /dev Directory
The /dev directory contains files that represent devices attached to the system, including physical devices, such as serial ports, and pseudodevices, such as a random number generator. Table A-6 lists the contents of the /dev directory.
File or directory |
Description |
bpf[0-3] |
Berkeley Packet Filter devices. See bpf(4). |
console |
The system console. This is owned by whoever is currently logged in. If you write to it, the output will end up in /var/tmp/console.log, which you can view with the Console application (/Applications/Utilities). |
cu.modem |
Modem device for compatibility with the Unix cu (call up) utility. |
disk[0-n] |
Disk. |
disk[0-n]s[0-n] |
Disk partition. For example, /dev/disk0s1 is the first partition of /dev/disk0. |
fd/ |
Devices that correspond to file descriptors. See the fd manpage for more details. |
klog |
Device used by syslogd to read kernel messages. |
kmem |
Image of kernel memory. |
mem |
Image of the system memory. |
null |
Bit bucket. You can redirect anything here, and it will disappear. |
ptyp[0-f] |
Master ends of the first sixteen pseudo-ttys. |
pty[q-w][0-f] |
Master ends of the remaining pseudo-ttys. |
random |
Source of pseudorandom data. See random(4). |
rdisk[0-n] |
Raw disk device. |
rdisk[0-n]s[0-n] |
Raw disk partition. |
stderr |
Symbolic link to /dev/fd/2. |
stdin |
Symbolic link to /dev/fd/0. |
stdout |
Symbolic link to /dev/fd/1. |
tty |
Standard output stream of the current ... |
Get Mac OS X for Unix Geeks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.