I'm kinda new with the unix shell, and I don't seem to find the answer of my problem :I have a folder containing multiple files : a correct filename contains exactly 13 characters (numbers + letters + underscore). For example :1305359000_PS.JPGSome files are named incorrectly, the error always being in the last characters, such as : 9009015000_PS_1.jpgI need to run a find / replace command that would work this way for all the files in my folder :IF filename > 13 characters (without the extension), then delete every character after the 13th.I tried some commands with mmv and awk, but i'm stuck so far.Edit : forgot to precise, the command should consider space(s) in the filename and delete them if present.
If filename has more than n characters, delete the last ones
bash;shell;scripting;find;replace