Replace all dots in filenames except the extension on Linux Posted on 21 January 202121 January 2021 By Shafiq Alibhai for f in .; do pre="${f%.}"; suf="${f##.}"; mv -i -f -- "$f" "${pre//./_}.${suf}"; done