rename thousands of files, spaces to underscores
Is there a one liner? They're all in one directory.
Your discussion
This browser holds the management token for this post.
Save management token
Keep this private. Anyone with the token can resolve or delete this discussion.
3 replies
for f in *\ *; do mv -- "$f" "${f// /_}"; done
That's bash. Run it with echo in front of mv first.
rename 's/ /_/g' * if you've got the Perl one. On Debian that's the rename package. The util-linux rename on some other distros has different arguments, and I've seen that catch people out.
bash one worked. thanks