From 1834 he taught at the Royal Academy of Navy and at the School of Commerce, until 1837, when he was invited to become an amanuensis in the Lisbon Civil Government, first in the treasury division and, starting 1848, in the division for the police, safety, and public health. During his many years in the civil service, he used his spare time to start investigating into the history of Portuguese bibliography, and began assembling a valuable library – he started gathering materials for what would be a successor of what was then the only available Portuguese bibliographic reference work, Diogo Barbosa Machado's century-old Bibliotheca Lusitana (published 1741–1758).
