The history of the '06 quake is utterly fascinating however. The earthquake was huge, a 7.9, and it lasted for around a minute. That is a whole 'lotta shaking going on. It caused some serious destruction, since none of the city was built with earthquakes in mind.
Destruction and fire at California and Front street
The sad part is that the actual earthquake wasn't the worst of it. The worst was the fire which was caused by the earthquake. The city government, and especially the mayor was totally corrupt at that time. The mayor took money that was earmarked for fire protection, and funneled it into his political machine. There was a plan to have high pressure water lines, emergency cisterns, and emergency contingency plans... but that was all nixed by the mayor. Building codes were not enforced because rich developers and landowners would lose money. So gas lines were laid next to electric lines. Brick buildings were not reinforced. Tenement buildings were built on sand. Etc, etc. It was a total recipe for disaster.
A building collapsed at Golden Gate and Hyde
The city burns out of control
The water mains buckled and broke in the earthquake itself, and since there were no emergency water supplies set up, there was no way to fight a fire. Also, in those pre-radio days, there was no emergency plan for the firemen and policemen. The city's fire chief was horribly injured in the quake, and could do nothing to co-ordinate the firemen. With nothing to stop it, and wood buildings everywhere, the city began to burn.
California and Powell street
It is hard to imagine, but there was literally nothing that anyone could do once the fire started. The whole city began to burn. At one point, when the government got itself together enough to realize the scope of what was going to happen, they decided the only way to stop the entire city burning to the ground was to create fire breaks. That is, they decided to demolish buildings which had not burned yet, so that the fire would not leap across the break and burn the buildings on the other side. The fire line was set up at Van Ness street, which is a very wide street to begin with. Just imagine, everything east of Van Ness was left to burn. At that time, that was pretty much the whole city.
The fire was stopped at Van Ness, and the rest of the city eventually burned itself out. The result was utter destruction. Just looking at the pictures, it appears as if a nuclear bomb went off in downtown San Francisco.
Looking down from what is now the US Mint near Deboce and Market towards downtown. You can clearly see how the houses on the west side of Van Ness were spared, and everything to the east is in ruins. You can also see the makeshift tent city set up on the hill for refugees.
After the fire was over, the next problem reared its head... where was everyone going to live. Most of the city was in ruins, and that meant that almost everyone was now homeless.
Eventually the city decided to build temporary housing for people. They built pre-fab one room shacks called "earthquake shacks" which they erected all over the city in parks and unused land.
Earthquake Shacks on Potrero Hill
The inside of an Earthquake Shack
I found all these pictures at the San Francisco Public Library photo collection