I have a lot of files in a directory that have
[!] in the file name. Is there a way to trim that out with a command in the terminal? Here's an example filename.
I would just use the 'sed' command. You can run a for each loop over all the files and parse out the "[!]".
for loop version:
for f in /path/to/files/*; do rename=`echo "$f" | sed 's/\[!]//'` mv "$f" "$rename" done
Otherwise I would suggest installing "rename" from homebrew if you have that installed. I also have a Automator right click service that does batch rename's if you would like a graphical way.
Yosemite features a graphical way to do this. Select all the files you want to rename, Control-click on them, select "Rename x Items...", and you'll get what is basically a find-and-replace window for file names.
In your case, select "Replace text" and substitute "[!]" with the empty string.