emptying files under Solaris

Eileen Reilly-Horch (reillye@Cyanamid.COM)
Wed, 1 May 1996 13:59:29 -0400

> I tried using the same method to clear wtmp after monthly bookeeping on
> our new solaris system as I was using on our sun using SunOs,
> (cat /dev/null > /var/adm/wtmp) and it does not seem to work.

The best way to empty a file but not completely erase it is to

cp /dev/null filename

That way you do not have to worry about recreating it with the right
permissions, links, etc. This can be especially important when you're
dealing with "system" files.

Eileen Reilly-Horch
American Cyanamid Co.
Agricultural Research Division
P.O. Box 400
Princeton, NJ 08543
reillye@cyanamid.com