An earthquake shook Los Angeles hours after a magnitude 5.0 quake and a series of aftershocks rattled the city.