replace spaces in file names with underscores code example
Example 1: replace filename space with underscore bash
for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done
Example 2: replace spaces in file names with underscores windows
Get-ChildItem C:\NewFolder -Directory -Recurse | Rename-Item -NewName {$_.Name -replace '_',' '}