Shell Common Scripts

Source: Internet
Author: User

Objective


Online collection, thank the old boy and the big God, often read their blog and video, script is absolutely their own pure hand, what shortcomings, but also please the Great God guidance. If you feel that there is a violation of the place, please contact me promptly, I immediately delete!!

Thanks again to the old boy, although did not report your class, but saw a lot of you out of the video and your blog. People should know how to be thankful, although not your students!

Part of the topic Link: http://oldboy.blog.51cto.com/2561410/1632876

    1. In the/chbo/directory, bulk create a fixed string starting with 10 random lowercase letters. html file

[[email protected]]# Cat CREATE_CHBO.SH#!/BIN/SHRANDPW () {</dev/urandom tr-dc A-Z | head-c${1:-10};echo;} [!-D/CHBO]&& mkdir-p/chbofor i in ' seq 9 ' do result= ' RANDPW ' Touch/chbo/${result}_chbo.htmldone[[email Pro Tected]]# sh create_chbo.sh2 [[email protected]]# ls/chbo/arwyievjgn_chbo.html eoxtksdqhl_chbo.html JBTPVJADIA_CHBO  . htmlbzkhbwtgmw_chbo.html hhrptuucgr_chbo.html mmfrghunuv_chbo.htmldldpbwhdfz_chbo.html ivfeekbiyf_chbo.html Uwqcaynijh_chbo.html

2. Rename the batch and change the CHBO in the above file to Chboy

[Email protected] mianshi]# sh chname.sh [[email protected] mianshi]# ls/chbo/arwyievjgn_chboy.html EOXTKSDQHL_CHBO y.html jbtpvjadia_chboy.htmlbzkhbwtgmw_chboy.html hhrptuucgr_chboy.html Mmfrghunuv_chboy.htmldldpbwhdfz_  chboy.html ivfeekbiyf_chboy.html Uwqcaynijh_chboy.html[[email protected] mianshi]# cat chname.sh #!/bin/shcd/chbofor F In ' LS *.html ' does mv $f ' echo $f |sed ' s#\ (. *\) _chbo.html#\1_chboy.html#g ' done







This article is from the "by The Knife" blog, please be sure to keep this source http://chboy.blog.51cto.com/9959876/1721946

Shell Common Scripts

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.