Jump to content

Mass Renaming Files: Difference between revisions

mNo edit summary
Line 23: Line 23:


=== In the Bash shell ===
=== In the Bash shell ===
 
for file in *.php; do mv "$file" "${file%.php}.gif"; done
OLDIFS=$IFS; IFS="\n"; for file in *.php; do newfile=`echo $file | sed -e 's/\.php$/\.gif/'`; mv $file $newfile; done; IFS=$OLDIFS
1

edit