How to get table output in `dnf search`?

In IT you always have to take history into account and make compromises.
Terminals and consoles had/have a limit of characters per line (~80). If you try to add table formatting, you will make everyone else who is restricted by character length in the console unhappy.

Fortunately, we have so many options in the terminal to write our own tools. In addition to @yuntaz’s workaround, I suggest you create a helper script that looks like this:

I named my script searchdnf and saved it in ~/bin

#!/bin/bash

if [ "$1" = "" ]; then
   echo " Please add a search string like 'searchdnf nextcloud' "
else
    	dnf search $1 | column -t -s ':'
fi

Speaking of readability, have you ever imagined what your nickname would be for those who are visually impaired and rely on screen readers?

You can here it (while pressing on the speaker icon):

You might consider a compromise too about your nickname :upside_down_face:

1 Like