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

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -