Today I wanted to convert a PDF file to a PNG from the Linux terminal. I didn't know how to make that happen so I did what I normally do in that scenario, I googled 'convert pdf to png linux terminal'. I found an answer on superuser.com and went back to my terminal and found that it worked great.
pdftoppm -png my.pdf > my.png
But then I thought about how I'll probably want to convert a pdf to a png again sometime in the future, but probably not frequently enough to commit that weirdly named command to memory. If I wanted to search for it without entering the ugly morass that is the modern web, how could I do that.
One way would be to search my terminal history for 'pdf' and 'png':
history | grep pdf | grep png 2492 pdftoppm -png o\ perfect\ love.pdf o\ perfect\ love.png
which works in this case, but maybe not in future commands that don't have the search keywords as prevalent.
Then I remembered about the `apropros` command, although I don't think I have ever used it seriously before this. ~apropos pdf~ gives a nice list of available commands that feature the word 'pdf' somewhere in their one-line manual descriptions. ~apropos -a pdf png~ will return entries that contain both ~pdf~ and ~png~, which on my my machine returned:
pdftocairo (1) - Portable Document Format (PDF) to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo pdftohtml (1) - program to convert PDF files into HTML, XML and PNG images
So `pdftoppm` wasn't listed, but there are two more options that I could have found without resorting to Google.
- Adam Frey, August 2020