首页 > 系统服务 > 详细

Linux special file

时间:2019-12-24 13:27:12      阅读:82      评论:0      收藏:0      [点我收藏+]

/dev/null

--Linux will disccard the any data written to /dev/null

--reading data from /dev/null results in an end-of-file

 

/dev/zero

it will genreate a zero data when reading from /dev/zero

for example, dd if=/dev/zero of=ab.txt count=10

 

/dev/full

The entry /dev/full behaves as if it were a file on a file system that has no more room.

 

/dev/random or /dev/urandom

The special devices /dev/random and /dev/urandom provide access to the Linux kernel’s built-in random number–generation facility.

Using od command to see what happen when you move mouse or typing something 

od -t x1 /dev/random

for /dev/urandom, it will never stop. e.g. od -t x1 /dev/urandom

Most software functions for generating random numbers, such as the rand function in the standard C library, actually generate pseudorandom numbers

Although these numbers satisfy some properties of random numbers, they are reproducible: If you start with the same seed value, you’ll obtain the same sequence of pseudorandom numbers every time.

To obtain better random numbers in computer programs requires an external source of randomness, use /dev/random or /dev/urandom

If you try to read a large number of bytes from /dev/random but don’t generate any input actions (you don’t type, move the mouse, or perform a similar action), Linux blocks the read operation.

Linux special file

原文:https://www.cnblogs.com/zjbfvfv/p/12090804.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!