An earthquake of preliminary magnitude 4.2 struck just off the coast of California today, according to the U.S. Geological Survey (USGS).