Suppose you have a lot of image files in lower case name and you want to change rename them to upper case filename or vice-versa
or from upper case to lower case
If filenames contains spaces in them then just wrap the variable names in "", like
for file in *.jpg; do mv "$file" "$(echo $file | tr a-z A-Z)" ; done
for file in *.jpg; do mv $file $(echo $file | tr a-z A-Z); done
or from upper case to lower case
for file in *.JPG; do mv $file $(echo $file | tr A-Z a-z); done
If filenames contains spaces in them then just wrap the variable names in "", like
for file in *.jpg; do mv "$file" "$(echo $file | tr a-z A-Z)" ; done
No comments:
Post a Comment