[Novalug] /dev question
Jon LaBadie
novalugml at jgcomp.com
Tue May 27 13:54:54 EDT 2008
On Tue, May 27, 2008 at 12:34:15AM -0400, Charles M Howe wrote:
> List,
>
> When I do ls /dev, I see several hundred short files of one type (and a
> handful of of other files of another type). Although I will not claim to
> have burned the midnight oil researching this question, I have spent a
> non-trivial amount of time on it but have been unsuccessful. What gives?
>
> Charlie the Perpetual Newbie
>
Mackenzie and Peter have already given you useful info. My only
comment regards your seeing 'two types' of files in /dev. I'm
guessing here that you have done an ls -l and seen something like:
crw-rw-rw- ...
brw-r--r-- ...
when you are used to seeing a '-' or a 'd' at the beginning of
each listing. If so, the b&c refer to "block" and "character"
type devices, devices that typically transfer data to and from
the computer in "chunks" (aka blocks) or characters (i.e. byte
by byte). Typical examples are disk drives vs terminals though
there is generally both a block and a character interface to
the disk drives.
The ls(1) command may also show additional letters in the first
position for other file types. These include 's' for network
sockets (may be transient for the duration of a network connection)
and 'p' for "named pipes" (aka FIFOs). FIFOs are created like other
devices with the mknod(1m) command and behave like your typical pipe
(ls | wc) with two primary exceptions: they appear as named
entries in the file system and the commands on either side do NOT
have to have a process relationship. I (or more likely some
daemon) can start the receiving command) and later someone else
could start feeding the FIFO.
HTH,
Jon
--
Jon H. LaBadie jon at jgcomp.com
JG Computing
12027 Creekbend Drive (703) 787-0884
Reston, VA 20194 (703) 787-0922 (fax)
More information about the Novalug
mailing list