Trim the middle of a file name 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. file001[!].ext
I would just use the 'sed' command.  You can run a for each loop over all the files and parse out the "[!]".

sed 's/\[!]//'


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.