bash - Change spaces with underscore in filename -


i have multiples files space, , want replace underscore command line (mac)

xxx xxx.jpg -> xxx_xxx.jpg

it's possible line command?

for files in current directory

for in *;do mv "$i" "${i// /_}";done 

if want match files spaces (to prevent tons of error messages when tries move files themselves) though use extended glob

shopt -s extglob in +(* *);do mv "$i" "${i// /_}";done 

Comments

Popular posts from this blog

java - How to compare two classes -

javascript - Why Selenium can't find an element that is graphically visible -

c# - Get the Class name in a class with atribute inside a attribute method -