An earthquake of magnitude 5.4 struck northern California, near the town of East Shore, the United States Geological Survey (USGS) reported on Thursday.