Skip to content

Instantly share code, notes, and snippets.

@l3robot
Created July 30, 2014 20:21
Show Gist options
  • Select an option

  • Save l3robot/dbcc6385d83442013592 to your computer and use it in GitHub Desktop.

Select an option

Save l3robot/dbcc6385d83442013592 to your computer and use it in GitHub Desktop.
Simple script to change the extension of many file in a folder. Usage : ext <old_ext> <new_ext>. It actually replace a part of a name to another
#!/bin/bash
LIST="$(ls | grep $1)";
for i in $LIST;
do mv $i ${i/$1/$2};
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment