If you want to bulk rename files I built a small script for that.
# Rename Bullk files.
# Renames all the files in PWD with the given extension.
#
# @param extension | jpg
# @param new_name | name
# Usage: rename jpg new_name
function rename() {
echo "———————————————— STARTED ————————————————"
# Counter.
COUNTER=1
# For do loop.
for file in *."$1"; do
mv "$file" "$2-$COUNTER.$1"
COUNTER=$[$COUNTER +1]
done
echo "———————————————— ✔✔✔ RENAMED Every $1 file in the PWD! ✔✔✔︎ ————————————————"
}
Just put it in your .bashrc or .zshrc and run Usage: rename jpg new_name this will rename all jpg files in the PWD to new_name-1.jpg, new_name-2.jpg, etc.
Cheers!
Vacation-Picture4.jpgback toPicture4.jpg? Namely, removing a word from file name. Thanks! – zyy Oct 04 '18 at 03:29${file/Vacation-/}as target (where${file/find/replace}) – grg Jul 15 '23 at 06:13