P. lineatus occurs in the Indian Ocean, in the western Pacific Ocean and sometimes enters freshwaters in East Africa and Madagascar.[1] The species now also occurs in the Mediterranean, having invaded as a Lessepsian migrant through the Suez Canal.[2] P. lineatus is found in coral reefs; it is also found in estuaries, tide pools and open coasts.[1]