Remove the suffix from file name with a command unix

If you have a lot of file with same suffix for example “.working” , and you want remove this suffix from all file you can do it writting this on the unix shell

Example we have this :

file1.working

file2.txt.working

etc ….

 

/usr/bin/find /srv/ftp/prod1/PEC_testcons/ -type f -name “*.working” -exec bash -c ‘mv $0 ${0/.working/}’ {} \;

 

After the commad we have this situation :

file1

file2.txt

etc…