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?
Try something like this, assuming all of your files were .txt's:
for files in *.txt; do mv “$files” `echo $files | tr ‘ ‘ ‘_’`; done