После awk
может вам помочь.
awk '$2 ~ /[0-9]+:[0-9]+:[0-9]+/{sub(/:[0-9]+ +/,OFS)} 1' Input_file
Если вы хотите сохранить вывод в самом файле Input_file, добавьте также > temp_file && mv temp_file Input_file
в вышеприведенную команду.
Объяснение: Добавление объяснения и здесь.
awk '
$2 ~ /[0-9]+:[0-9]+:[0-9]+/{ ##Checking condition here if 2nd field is matching digit colon digit colon digit pattern then do following.
sub(/:[0-9]+ +/,OFS) ##Using substitute function of awk to substitute colon digit(s) then space with OFS whose default value is space in current line.
}
1 ##awk works on method of condition and then action, so making condition TRUE here and not mentioning action so print will happen.
' Input_file ##Mentioning Input_file name here.