Compare string of the serial interface using strcmp and Serial.read()

how to modify this to work with carriage return and newline \r\n ?

Use a text editor. Or post "this".