How to remove special characters in file names?
<p>When creating playlists I often came across files that would break the playing process. Such would be files with spaces or apostrophes. I would fix it with the following command</p>

<pre><code>for file in *.; do mv "$file" `echo $file | tr " " '_'` ; done **(for spaces)**
</code></pre>

<p>Now I more often come across files with commas, apostrophes, brackets and other characters. How would I modify the command to remove such characters?</p>

<p>Also tried <code>rename 's/[^a-zA-Z0-9_-]//' *.mp4</code> but it doesnt seem to remove spaces or commas</p>