Fastest way to rename filenames with space to dash in linux

Last updated on September 10th, 2014 at 06:29 am

I want to mass rename hundred of filenames like
filename 001.jpg to filename-001.jpg



filename 099.jpg to filename-099.jpg

I use this command to rename all in few seconds in my MacBook Pro.
I think it is fine to run in any linux.
[code lang=”bash”]
for f in *\ *; do mv "$f" "${f// /-}"; done
[/code]

Tags:

Discover more from Juzhax Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading