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?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Replacing more than n consecutive values in Pandas
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
Quote your variables:
Remove the "echo" to do the actual rename.
The easiest way to replace a string (space character in your case) with another string in
Linux
is usingsed
. You can do it as followsHope this helps.
This should do it:
Here is another solution:
I believe your answer is in Replace spaces in filenames with underscores.
Use sh...
If you want to try this out before pulling the trigger just change
mv
toecho mv
.