Generate a random filename in unix shell

前端 未结 14 676
说谎
说谎 2020-12-22 23:39

I would like to generate a random filename in unix shell (say tcshell). The filename should consist of random 32 hex letters, e.g.:

c7fdfc8f409c548a10a0a89a7         


        
14条回答
  •  自闭症患者
    2020-12-23 00:05

    The first answer is good but why fork cat if not required.

    tr -dc 'a-f0-9' < /dev/urandom | head -c32
    

提交回复
热议问题