Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 8.42 How can I create a /dev/zero special file?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Counties ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 8.41 Where can I look up HP part numbers?
Next Document: 8.43 Why is tail's output truncated for large amounts of input?
See reader questions & answers on this topic! - Help others by sharing your knowledge

Prior to 11.11, HP-UX did not come with the special device file /dev/zero.
However, it is possible to create one in 11.0 using the following command:

  # mknod /dev/zero c 3 4

Of course, use of the device file on an 11.0 system is unsupported by HP.

In conjunction with the dd command, /dev/zero can be used to fill a file
with a given number of the '\0' (nul) character. For example, to create a
1 MB file named "foo" full of nul characters, use the command:

  $ dd bs=1024k count=1 if=/dev/zero of=foo

Note the same thing can be accomplished in 10.x using the prealloc(1)
command as follows:

  $ prealloc foo 1048576

Note, filling a file with zeroes is not a secure way to wipe file data
from disk.  For this, you must use a utility such as 'shred', which is
part of the GNU fileutils package.

A device file with slightly similar behavior to /dev/zero can be created
on 10.x as follows:

  # mknod /dev/full c 3 3

Reading from this device will always succeed and report that the
requested number of bytes were read. However, no data will actually be
copied to the read buffer.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 8.41 Where can I look up HP part numbers?
Next Document: 8.43 Why is tail's output truncated for large amounts of input?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM