# Matrix Style

while true; do printf "\e[32m%X\e[0m" \$((RANDOM%2)); for ((i=0; i<\$((RANDOM%128)); i++)) do printf " "; done; done
Unlike other alternatives, this command only relies on bash builtins and should also work on windows platforms with the bash executable. Sparseness corresponds to the number 128 and can be adjusted. To print all possible digits instead of only 0 and 1 replace RANDOM%2 by RANDOM%10 or RANDOM%16 to add letters [A-F].
Sample Output
```           0                         0              0                    0          0
01               0              1       1     00   0                   1
1                   0         0         0                 0         1
0              0 0                       0      0                          0
1          1  0             1          1             1                      0
1        0         1                            0   0           0                  1
1                       0     1
```

2
2012-11-27 10:40:42

## 10 Alternatives + Submit Alt

• 68
tr -c "[:digit:]" " " < /dev/urandom | dd cbs=\$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"
· 2009-06-30 17:23:49
• I like the fact the Patola's version uses only ones and zeros, but I also like the sparse output of the other versions. This one combines both of those features and eliminates some unnecessary cruft. You can vary the sparseness by changing "\$((\$RANDOM % 5))" to another number. The number in this term "\$((\$RANDOM % 4))" controls how frequently the numbers are output bold.

21
echo -e "\e[32m"; while :; do for i in {1..16}; do r="\$((\$RANDOM % 2))"; if [[ \$((\$RANDOM % 5)) == 1 ]]; then if [[ \$((\$RANDOM % 4)) == 1 ]]; then v+="\e[1m \$r "; else v+="\e[2m \$r "; fi; else v+=" "; fi; done; echo -e "\$v"; v=""; done
· 2009-09-27 15:30:38

• 8
COL=\$(( \$(tput cols) / 2 )); clear; tput setaf 2; while :; do tput cup \$((RANDOM%COL)) \$((RANDOM%COL)); printf "%\$((RANDOM%COL))s" \$((RANDOM%2)); done
· 2009-12-15 02:48:28
• Solves "tr" issues with non C-locales under BSD-like systems (like OS X)

7
LC_ALL=C tr -c "[:digit:]" " " < /dev/urandom | dd cbs=\$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"
· 2009-07-02 07:10:33
• A bit different from some of the other submissions. Has bold and uses all c printable characters. Change the bs=value to speed up and increase the sizes of the bold and non-bold strings.

5
echo -ne "\e[32m" ; while true ; do echo -ne "\e[\$((\$RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done
· 2009-12-19 19:05:04

### What Others Think

Really admirable blog updates you bring for us and there are the developers who need help with syntax in coding and for them sharing information quite useful. Thank you and keep going to share such an upcoming post on https://topbritishwriters.com/ukassignmentshelp-review/ for us as well.
LucieGreenholt · 223 weeks ago
Our prior goal is to surpass all the expectations of our client by providing outstanding customer support service, greater value and increased flexibility which in results optimize system functionality and improve operation efficiency. erp software company in india top erp vendors erp software company
delhis · 220 weeks and 6 days ago
We are best Professional SEO, Digital Marketing, Web Designing and Web Development Company in Bangalore. PPC agency in bangalore and best seo company in bangalore and smo company in bangalore
delhis · 218 weeks and 2 days ago
We all come to work everyday to solve the most basic to the most complex visa related problems. We are passionate about providing you best suited solution to your needs. canada visa lawyer in india and canada express entry
delhis · 218 weeks and 2 days ago
The best way to solve any mobile signal reception problem is to use a Mobile Signal Booster
mysignalboosters · 121 weeks and 6 days ago
With a team of over 380 visa & immigration experts in 68 countries we help our clients fulfill their dreams of immigration, overseas studies, tourist visas, foreign business setup, acquire new citizenship, permanent residency and settlement, work overseas, Canada Migration.
mysignalboosters · 121 weeks and 6 days ago
iranarthistory · 26 weeks and 4 days ago

### What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

### What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.