We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

benpjohnson on 09/13/07


Tagged

files batch rename bulk


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

basicmagic
moonbather
ss44
knuton


batch rename files


Published in: Bash 


Manipulate the names of all the files in a folder in bash

  1. for FILE in * ; do NEWFILE=`echo $FILE | sed 's/-//g'` ; mv "$FILE" $NEWFILE ; done

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: benpjohnson on April 15, 2008

replace mv with echo to trial a new rename method

Posted By: benpjohnson on April 15, 2008

replace mv with echo to trial a new rename method

You need to login to post a comment.