Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In reference to this question:

How does cat /dev/urandom make some terminal emulators go wonky?

share|improve this question
up vote 15 down vote accepted

While there are your normal, printable ASCII characters that are sent back and forth on a terminal, there are also many unprintable characters that are used for the system to communicate with the terminal. For example, if a program sends the character 0x07 ("ASCII Bell character"), your terminal should beep.

Other special sequences can be used to change the color of text being displayed, which direction it's displayed, the title of the window, the size of the window, etc., among many other things.

When you

cat /dev/urandom

A bunch of random characters are dumped to your terminal, and the terminal can't tell that it's not real control codes.

Because the program is effectively sending random commands to the terminal, the terminal ends up in a random, often unusable state.

share|improve this answer

actually using this command will show if the NSA is in your computer at any given moment:

strings < /dev/urandom | grep nsa -i

If you get any positive results, it is a tell tale sign of them snooping in your computer. This even works in air-gapped machines, and the reason your bash sometimes gets "wonky" is because of an NSA countermeasure. Be careful!

share|improve this answer
Hilarious, but obviously not true, just in case any newbs stroll past! – EngineerBetter Aug 5 '15 at 9:23

Some of the random output will be ANSI escape codes (, which can do fun stuff like hide the cursor or select alternate fonts. Another possibility are unicode sequences: A random bytestream will not be valid UTF-8, and probably not all unicode-aware terminals handle that gracefully.

share|improve this answer

cat /dev/urandom will give you a stream of random bytes between 0 and 255, not all of those values are valid text characters. Because the terminal window was feed invalid data it was never expected to handle it could get the terminal application in to a "broken" state.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .