I have a number of files in a folder, and I want to replace every space character in all file names with underscores. How can I achieve this?
I prefer to use the command 'rename', which takes Perl-style regexes:
rename "s/ /_/g" *
You can do a dry run with the -n flag:
rename -n "s/ /_/g" *