您的位置:首页 > 运维架构 > Linux

Linux中的特殊文件-/dev/zero

2016-01-14 00:11 260 查看
转载请注明来源:/article/9699087.html

1 /dev/zero

1.1 维基百科关于/dev/zero说明

/dev/zero is a special file in Unix-like operating systems that provides as many null characters (ASCII NUL, 0x00) as are read from it. One of the typical uses is to provide a character stream for initializing data storage.

Read operations from /dev/zero return as many null characters (0x00) as requested in the read operation.

Unlike /dev/null, /dev/zero may be used as a source, not only as a sink for data. All write operations to /dev/zero succeed with no other effects. However, /dev/null is more commonly used for this purpose.

以上引自维基百科https://en.wikipedia.org/wiki//dev/zero

简单翻译:

/dev/zero是类Unix操作系统中的一个特殊文件,用来提供一个空字符文件,其一个典型的应用就是提供字符流进行数据存储初始化。

/dev/zero的读操作会依据其请求返回大量的空字符。

不像 /dev/null, /dev/zero可能被用作资源,而不仅仅是用来做数据回收池。所有针对/dev/zero的写操作均OK,没有什么影响,不过,无用输出重定向还是/dev/null更适合。

有关 /dev/null重定向的内容,参考《Linux中的黑洞(black hole)-/dev/null》
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: