码迷,mamicode.com
首页 > 系统相关 > 详细

Linux special file

时间:2019-12-24 14:11:29      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:read   you   data   ice   from   random   ora   time   com   

/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

标签:read   you   data   ice   from   random   ora   time   com   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!