cat /dev/urandom

Bob Johnson bob89 at
Tue Jul 26 23:49:18 GMT 2005

Tue, Jul 26, 2005 at 6:32 PM Matt Juszczak <matt at> 

> Hi all,
> Quick question.
> shell# cat /dev/urandom
> can that executed as root cause any harm to the system?  What if a random
> sequence of `rm *` was generated... would it be executed?

Not from a virtual terminal.  There may have been an old hardware "smart" 
terminals that would let you trick it into echoing stuff back through the 
keyboard buffer with the appropriate esc sequence, but emulators for those 
have such functions disabled by default these days, for the obvious reason.  
I'm willing to assume that includes whatever you are using for a terminal 
> I tried that to fix my terminal and forgot it might cause damage as root,
> even if its just being cat'd to the screen.  I thought I saw some files
> fly by which would indicate an execution of `ls`....

Highly unlikely, unless you are actually using an old hardware terminal, then 
it is still pretty unlikely.

For example:

$ cat test.txt
This is a test file.
`ls -l /`

cat just types the characters out on the screen.  The `ls -l` didn't get 

> Just curious....

- Bob

More information about the freebsd-questions mailing list