Command Explained: “Look Busy On *nix”

Here’s a command that I posted on my main blog last year. Open a terminal and give it a try (stop it with Ctrl+C)!
$ cat /dev/urandom | hexdump -C | grep "34 32"

`The Penguin' says...

I recently posted a command to “Look Busy On *nix“:
$ cat /dev/urandom | hexdump -C | grep "34 32"

If you ran it, you console/terminal screen should have been filled with lines like these:

I will break apart the command and explain what it actually did.

$
Indicates that this command should be run as a regular user (i.e. without root privileges). This isn’t actually part of the command and shouldn’t be included when typing it into the shell.
cat
Output the contents of the specified file(s) to stdout.
/dev/urandom
The file from which to read. /dev/urandom is a special file that acts as a pseudo-random number generator.
|
Redirects or “pipes” the output of the previous command into the input of the next command (stdout to stdin).
hexdump
Outputs a hexdump of the specified file, or stdin if no file specified.
-C
From the man page:

View original post 91 more words