Skip to content

Instantly share code, notes, and snippets.

Avatar

James Nodws Nodws

View GitHub Profile
@Nodws
Nodws / Add prefix or suffix
Last active Jul 18, 2019
Find-Replace string in file's name
View Add prefix or suffix
#add prefix
rename s/'^'/'MyPrefix'/ *
#add suffix
rename s/'$'/'MySuffix'/ *
#numbered
n=1; for f in ./*.jpg; do mv "$f" $n.jpg; n=$((n+1)); done