Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is /dev/nul?

453 views
Skip to first unread message

Stefan Åhser

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to
What is this?
> ls -l /dev/nul
-rw-r--r-- 1 root system 0 Oct 26 10:24 /dev/nul

It looks like an ordinary empty file, but what is it doing in my /dev
dir?
And no, I havn't misstyped /dev/null, Iv'e seen this on several
machines.

/Stefan

Matthew Landt

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to

Sounds like any user with group "system" authority ACCIDENTLY redirected an
output the /dev/nul accidently. /dev/null is a character special file and
has a "c" at the beginning of the ls output.

- Matt

--
_______________________________________________________________________
Matthew Landt - AIX and HACMP Cert. Specialist - la...@austin.ibm.com
<< Comments, views, and opinions are mine alone, not IBM's. >>

Claude E. Watson

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to

Stefan Åhser wrote in message <3A0AC035...@Mbull.no>...

>What is this?
>> ls -l /dev/nul
>-rw-r--r-- 1 root system 0 Oct 26 10:24 /dev/nul
>
>It looks like an ordinary empty file, but what is it doing in my /dev
>dir?
>And no, I havn't misstyped /dev/null, Iv'e seen this on several
>machines.


/dev/null is a special device found on most *NIX systems that one uses to
throw things away, among other things. If you direct error messages to
/dev/null the redirection works fine but the messages just disappear. If
you cp /dev/null to a file then you retain your filename with 0 length,
useful for trimming log files to zero length.

The short answer is yes, it's supposed to be there and yes, it is useful.

Claude


Nicholas Dronen

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to
Stefan Åhser <sta...@mbull.no> wrote:

> What is this?
>> ls -l /dev/nul
> -rw-r--r-- 1 root system 0 Oct 26 10:24 /dev/nul

> It looks like an ordinary empty file, but what is it doing in my /dev
> dir?
> And no, I havn't misstyped /dev/null, Iv'e seen this on several
> machines.

$ ls -l /dev/nul*
-rw-r--r-- 1 root system 0 Dec 01 1999 /dev/nul
crw-rw-rw- 1 root system 2, 2 Nov 09 10:11 /dev/null
crw-rw-rw- 1 root system 15, 30 Nov 24 1999 /dev/nuls

It looks like a bug in the AIX installer or boot process, wherein
a program is probably called like:

command >/dev/nul 2>&1

The file most certainly shouldn't exist in /dev. If it's supposed
to be there, AIX product management is on crack.

Regards,

Nick Dronen

Nicholas Dronen

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to
Claude E. Watson <claude...@earthlink.net> wrote:


> Stefan Åhser wrote in message <3A0AC035...@Mbull.no>...

>>What is this?
>>> ls -l /dev/nul
>>-rw-r--r-- 1 root system 0 Oct 26 10:24 /dev/nul
>>
>>It looks like an ordinary empty file, but what is it doing in my /dev
>>dir?
>>And no, I havn't misstyped /dev/null, Iv'e seen this on several
>>machines.

> /dev/null is a special device found on most *NIX systems that one uses to


> throw things away, among other things. If you direct error messages to
> /dev/null the redirection works fine but the messages just disappear. If
> you cp /dev/null to a file then you retain your filename with 0 length,
> useful for trimming log files to zero length.

> The short answer is yes, it's supposed to be there and yes, it is useful.

Claude:

Your answer is misguided, due to the fact that you didn't pay
attention when you read his post. He's referring to an actual
file named '/dev/nul.'

Regards,

Nick Dronen

Chris Mattern

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to
Garbage left by a root script written by somebody who can't
spell "/dev/null".

--
Chris Mattern

"Stefan Åhser" <sta...@Mbull.no> wrote in message news:3A0AC035...@Mbull.no...


> What is this?
> > ls -l /dev/nul
> -rw-r--r-- 1 root system 0 Oct 26 10:24 /dev/nul
>
> It looks like an ordinary empty file, but what is it doing in my /dev
> dir?
> And no, I havn't misstyped /dev/null, Iv'e seen this on several
> machines.
>

> /Stefan

Richard D. Latham

unread,
Nov 10, 2000, 3:00:00 AM11/10/00
to
"Chris Mattern" <sys...@gwu.edu> writes:

Interesting :-)

I just checked and found this "/dev/nul" file on every one of my
4.3.3.x machines. From the date, I appears that the file is being
created by the _initial_ AIX 4.3.3 installation or upgrade (from
4.3.2) onto the machine.

I didn't keep the exact dates that I installed/upgraded these 10
boxes, <silly me>, but on one of them that came with 4.3.3
"pre-installed, the date on the file is BEFORE the machine was
shipped to me from the factory ... which seems pretty conclusive,
somehow :-)

I wonder if the stutter is hiding in the Welcome Center somewhere ?

--
#include <disclaimer.std> /* I don't speak for IBM ... */
/* Heck, I don't even speak for myself */
/* Don't believe me ? Ask my wife :-) */
Richard D. Latham lat...@us.ibm.com

jcol...@nospam.nspr.com

unread,
Nov 10, 2000, 3:00:00 AM11/10/00
to
Since the /dev/nul is a plain file and not a device file, I'd assume that
someone as root just mistyped a redirect.

fsbooks

unread,
Nov 11, 2000, 3:00:00 AM11/11/00
to
In article <ud3dgzk...@us.ibm.com>,

Ditto. /dev/nul is on all our machines with 4.3.3, with a date prior to
delivery on those shipped with 4.3.3. Again, rather interesting.


Sent via Deja.com http://www.deja.com/
Before you buy.

Martin Pazderka

unread,
Nov 27, 2000, 3:00:00 AM11/27/00
to
On Fri, 10 Nov 2000 18:40:38 +0100, "PCS" <pch...@decan.fr> wrote:
>I saw that too.
>Maybe, it's a good idea to prevent creation of BIG files /dev/nul by
>common users.

I don't think so since common users aren't allowed to create files in
/dev.

Martin
--
Please use domain "gmx.net" when responding via smtp.


sdoy...@hotmail.com

unread,
Dec 1, 2000, 3:00:00 AM12/1/00
to
In article <asr42t82he1crr0ea...@4ax.com>,

/dev/null is a special file that you can write to but which doesn't get
any bigger.

For example you could write out a log file to /dev/null but the logfile
would just disappear.

Scott

Martin Pazderka

unread,
Dec 4, 2000, 3:00:00 AM12/4/00
to
On Fri, 01 Dec 2000 15:52:11 GMT, sdoy...@hotmail.com wrote:

>/dev/null is a special file that you can write to but which doesn't get
>any bigger.
>
>For example you could write out a log file to /dev/null but the logfile
>would just disappear.

Please read the whole thread before trying to post something.

0 new messages