0

Hello Everybody,

I am on a Ubuntu system and I just came across /dev/random

I tried searching for examples of how to use this utility (or file/ or command) to generate a random number but I cannot find anything.

Quick note I am trying to generate a random number on the command prompt not in a C program. Is this possible ?

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Narue
0

If you're just trying to display the result, something like this would work:

$ cat /dev/random | od -tl -w4

Remember that /dev/random is just a file. You can process it like any other file.

Edited by Narue: n/a

0

I ran the command as you said and I am getting an error

~$ cat /dev/random | od -tl -w4
od: invalid character `l' in type string `l'
^C
~$ ^C

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.