{"thread":{"id":"tRfEteEQHqHL","title":"rename thousands of files, spaces to underscores","content":"Is there a one liner? They're all in one directory.","category":"help","status":"resolved","author":"Anonymous","createdAt":"2026-11-04T20:51:50.234Z","updatedAt":"2026-11-05T01:51:50.234Z","expiresAt":null,"replyCount":3},"replies":[{"id":"bg5xlt0BUv0Q","content":"for f in *\\ *; do mv -- \"$f\" \"${f// /_}\"; done\n\nThat's bash. Run it with echo in front of mv first.","author":"awkward","createdAt":"2026-11-04T21:19:50.234Z"},{"id":"Wqd5A4p_Dzgl","content":"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.","author":"old_perl_guy","createdAt":"2026-11-04T21:52:50.234Z"},{"id":"zWgeGpjS16Mg","content":"bash one worked. thanks","author":"Anonymous","createdAt":"2026-11-05T01:51:50.234Z"}]}