The increasingly ominous announcements from officials — and the wall-to-wall coverage — sent New Yorkers hurrying to buy staples like canned food and candles. “Is this the apocalypse supply line?” a man asked as he stood in a line that stretched outside a hardware store on First Avenue, waiting to buy batteries.

Shoppers in places found that the shelves had been cleaned out. Some grocery stores remained open overnight — shoppers with Whole Foods bags could be seen up and down Broadway, near Columbus Circle. In shore towns in New Jersey and on Long Island, vacationers waited in lines at gas stations and watched as bulldozers built berms on low-lying beach roads.

In Point Lookout on Long Island, as in Point Pleasant Beach in New Jersey, homeowners covered windows with plywood, and boaters struggled to get their vessels away from docks. There were lines at the ramps at marinas as boats were pulled from the water and hitched on trailers, one at a time.

In the city — from high rises in Manhattan to smaller buildings in Queens and Brooklyn — apartment dwellers with balconies and terraces hauled in their patio furniture and their potted plants. The Federal Bureau of Investigation’s New York field office, with more than 1,000 agents in two buildings in Lower Manhattan, told employees by e-mail that they should put files in drawers for the weekend rather than leave them lying on their desks, apparently out of concern that paperwork would go flying if the storm broke the windows.

The announcement about the transit shutdown and the evacuation of what the city called Zone A low-lying areas prompted a cascade of cancellations for Saturday and Sunday: Broadway shows, the Mets’ games against the Atlanta Braves at Citi Field, the performances by the Dave Matthews Band on Governors Island and the outdoor showing of opera movies at Lincoln Center, among others. Even the New York Aquarium and the Bronx, Central Park and Prospect Park Zoos closed for the weekend.

Some Atlantic City casinos made plans to stop rolling the dice and turn off the slot machines by 8 p.m. Friday. The naval submarine base in Groton, Conn., sent four submarines out to ride out the storm deep in the Atlantic Ocean.