I have a list of file names in a directory (/path/to/local). I would like to remove a certain number of characters from all of those filenames.
/path/to/local
mv $filname $(echo $filename | sed -e 's/.....\.moc1$//');
or
echo ${filename%%?????.moc1}.moc1
%% is a bash internal operator...