linux and robert

2010年1月13日 星期三

generate a (pseudo) random number in sh

Print a pseudo-random byte (hex) in sh:

cat /dev/urandom | od -t x1 -A n -N 1

->89

-----------

Create a pseudo-random file of size 1 MB:
dd if=/dev/urandom of=a.log bs=1M count=1


Ref:
Re: generating random number in sh
http://linuxcommando.blogspot.com/2008/06/create-file-of-given-size-with-random.html

張貼者: no 於 上午10:13
以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook分享到 Pinterest

沒有留言:

張貼留言

較新的文章 較舊的文章 首頁
訂閱: 張貼留言 (Atom)

網誌存檔

  • ►  2016 (1)
    • ►  6月 (1)
  • ►  2014 (1)
    • ►  3月 (1)
  • ►  2012 (5)
    • ►  12月 (2)
    • ►  3月 (1)
    • ►  2月 (2)
  • ►  2011 (9)
    • ►  12月 (1)
    • ►  10月 (1)
    • ►  6月 (2)
    • ►  5月 (1)
    • ►  3月 (1)
    • ►  2月 (2)
    • ►  1月 (1)
  • ▼  2010 (9)
    • ►  12月 (2)
    • ►  5月 (1)
    • ►  4月 (3)
    • ▼  1月 (3)
      • grub rescue after re-partition by Windows
      • generate a (pseudo) random number in sh
      • Install a New font in Ubuntu
  • ►  2009 (16)
    • ►  12月 (3)
    • ►  11月 (3)
    • ►  10月 (4)
    • ►  9月 (5)
    • ►  8月 (1)

關於我自己

no
檢視我的完整簡介
簡單主題. 技術提供:Blogger.