Ancestry.com has one of the largest online collections of city directories, with a focus on coverage between the 1880 and 1900 U.S. federal census, as well as for 20th century research. Their U.S. City Directories collection is available only to paid subscribers. The new Beta U.S. City Directories collection (subscription) offers better search results than the original collection, but for best results browse directly to the city of interest and then page through the available directories rather than relying on search.
The City Directories collection online at subscription-based website Fold3, includes directories for thirty large metropolitan centers in twenty U.S. states. As with the collection at Ancestry.com, better results are achieved by browsing the directories manually rather than relying on search.
The Historical Directories Searchable Library is a free website from the Univeristy of Leicester in England, with a nice collection of digitized reproductions of local and trade directories for England and Wales for the period 1750–1919.
City Directories at DistantCousin is a free online archive of transcribed city directory records and scanned images from localities across the U.S. The coverage is hit or miss depending on your locality of interest, but is entirely free!
For additional help locating online historical city directories, check out the Online Historical Directories Website by Miram J. Robbins, or try a search for your locality and "city directory" in your favorite search engine such as Google or Mocavo.