[NTLUG:Discuss] Stupid Question

cbbrowne@hex.net cbbrowne at hex.net
Thu Apr 26 14:35:43 CDT 2001


On Thu, 26 Apr 2001 13:59:46 CDT, the world broke into rejoicing as
"WILLIAM PEARSON" <WPEARSON at cyclix.com>  said:
> Hello,
> 
> I'm a newbie to linux so pardon the stupid question. What exactly does the
> "/dev/null" directory do?
> 
> Is it a directory where things are routinely purged or is it something
> else? If a file were to be placed in that directory what exactly would
> happen to it??

/dev/null isn't a directory; it's a file.  It is a file that accepts
whatever is thrown into it and immediately discards it.

It is not a place to put files, but rather a place to put output.

% cat /tmp/* > /dev/null
   Takes all the files in /tmp, catenates their contents together, and
   throws it into the "trash."

% do_something < input_file > output_file 2> /dev/null
   Runs the program "do_something", taking input from one place,
   dropping input somewhere else, and then throwing away any
   error messages that might come along.
--
(concatenate 'string "cbbrowne" "@ntlug.org")
http://vip.hyperusa.com/~cbbrowne/resume.html
Oh, no.  Not again.
-- a bowl of petunias



More information about the Discuss mailing list