I have many files in a folder and I want to add either prefix or a suffix (not both) to them. I checked here and found out I can usefor filename in *.jpg; do mv $filename prefix_$filename; done;to add a prefix to all files ending in .jpg (and if I remove the .jpg, it will add the prefix to all the files in the current folder).However, I'd like to be able toAdd a sufix (that is, rename filename.ext to filename.whatever.ext),Check if the prefix or suffix is already present and then skip,Create an alias that accepts arguments such as addprefix whatever *.ext or addsufix whatever *.*
Rename files in the local folder adding a prefix or suffix
shell;shell script;rename