CoolComputing Logo
Coupons/Deals  ·  New Promo Codes/Coupons  · October 23, 2018

Renaming multiple files without the rename utility

Posted on Tuesday, August 13, 2002 @ 04:01:49 PM CDT by David Yee [] [read 3466 times]

 
Tips: Linux/Unix world
If you use the bash shell (and don't have the "rename" utility), here's a way to rename multiple files, in this case from *.html to *.php:

for f in *.html; do mv $f `basename $f .html`.php; done





Please rate this article or post a brief review of Renaming multiple files without the rename utility or comment on benchmark/performance, features, availability, price or anything else regarding Renaming multiple files without the rename utility. Thanks!

Renaming Multiple Files Without The Rename Utility Rating: 2.1/5 (10 votes cast)

Your Name:
I have read and agreed to the Review Posting Agreement.
Review Title:
Comment/Review:
 
dateComment #Article Comments
2003-01-25 21:16:5362$f contains the ".html" also. Need to match everything prior to the html extension. This code will work:

for f in *.html; do cp $f `basename ${f%%html}`txt; done