Phrase(s): pace back and forth [and] pace up and down
to walk over and over the same short route nervously or anxiously. • The leopard paced back and forth in its cage. • I paced up and down, worrying about a variety of things.
McGrawhill's American Idioms And Phrasal Verbs