Shell Utility case: Batch generation of random character filenames

Source: Internet
Author: User

The code is as follows:

1#!/bin/SH2 #################################################################3 # Author:91coder4# blog:www.cnblogs.com/91coder5 #################################################################6 7 # Create a directory8path=/91coder9[-D"$Path"]||mkdir-P $PathTen  One # Create a file A  forNinch`seq Ten` -  Do -random=$ (OpenSSL rand-base64 +|sed 's#[^a-z]# #g'|Cut-C2- One) the     Touch$Path/${random}_91coder.html -  Done

Operation Result:

1[Email protected] ~]# ll/91coder/2Total03-rw-r--r--.1Root root0Feb4  -:Wuyidgyelwxmgt_91coder.html4-rw-r--r--.1Root root0Feb4  -:Wuyiigcaczxyun_91coder.html5-rw-r--r--.1Root root0Feb4  -:Wuyiitrwznpytf_91coder.html6-rw-r--r--.1Root root0Feb4  -:Wuyimnjzmclxrs_91coder.html7-rw-r--r--.1Root root0Feb4  -:Wuyindcbqhttit_91coder.html8-rw-r--r--.1Root root0Feb4  -:Wuyinexnbwzmak_91coder.html9-rw-r--r--.1Root root0Feb4  -:Wuyipobtynbzfe_91coder.htmlTen-rw-r--r--.1Root root0Feb4  -:Wuyistusewzwyn_91coder.html One-rw-r--r--.1Root root0Feb4  -:Wuyiwbmzcpugna_91coder.html A-rw-r--r--.1Root root0Feb4  -:WuyiZgmqeywark_91coder.html

Shell Utility case: Batch generation of random character filenames

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.