sed command

Hi Can any one explain the below sed command.

cat file.txt|sed 's/^Connected\.//g' | sed 1d

Second sed 1d is deleting 1st line .
But i have no idea of first sed.

Please help.

Deletes the string "Connected." which is found at the beginning of any line.
She "s" at the beginning means "replace string". The first pattern "/^Connected\./" is the pattern to match, the second section "//" means the string to replace it with (in this case empty because they want to simply delete the string) and "g" means globally across the whole line/file. The matching pattern itself - "^" denotes the beginning of the input line and "\." is a dot - "." by itself means any character.

1 Like