Artificial intelligent assistant

Rename a portion of multiple files Take a number of files named: data_a_LT.fits data_a_LT.coo data_a_LT.ec data_a_LT.grp I want to replace all "a_LT" with "LT_A" such that I have: data_LT_A.fits data_LT_A.coo data_LT_A.ec data_LT_A.grp How does one do this with one command. Something like: mv *a_LT* *LT_A*

If `rename` is available use this command:


rename 's/a_LT/LT_A/' *


Another approach with `awk`:


find -type f | awk -F'a_LT' '{printf "mv \"%s\" \"%sLT_A%s\"\
", $0, $1, $2}' | bash

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a01f71ca8d0f7b27e699820f9e17369c