とcut
:
$ cut -d' ' -f2- file
PT disconnected
CC1 received TCMTM
CC2 received TCMTM
TFT received TCMTM
FEC received TCMTM
スペースを区切り文字として設定し、フィールド 2 から最後のフィールド ( f2-
) までを出力します。
とawk
:
$ awk '{$1=""}1' file ## leading space :(
PT disconnected
CC1 received TCMTM
CC2 received TCMTM
TFT received TCMTM
FEC received TCMTM
最初のフィールドを空に設定します。
$ awk '{for (i=1;i<=NF; i++) $i=$(i+1); NF=NF-1}1' file
PT disconnected
CC1 received TCMTM
CC2 received TCMTM
TFT received TCMTM
FEC received TCMTM
フィールド番号を 1 ずつ減らし、それぞれを前の番号に移動します (したがって、最初の番号は削除されます)。
とsed
:
$ sed 's/^[^ ]* //g' file
PT disconnected
CC1 received TCMTM
CC2 received TCMTM
TFT received TCMTM
FEC received TCMTM
行頭から最初のスペースまでをすべて削除します。
またはあなたに基づいてsed
:
$ sed "s/^[0-9:.]* //g" file
PT disconnected
CC1 received TCMTM
CC2 received TCMTM
TFT received TCMTM
FEC received TCMTM
行頭から最初のスペースまでのすべての文字0-9
または:
またはを削除します。.