NapoleonTheCake NapoleonTheCake - 5 months ago 59
Linux Question

Wildcards exclude

I want to install all fonts from Ubuntu official repo. However, just using apt install font* will meet conflicts. So I need to somehow include all font* but exclude something like *-tail so package font-test will be installed but font-test-tail.



You can search for all font packages and filter as required and then use the resulting list for the install command:

# apt install $(apt-cache search font | grep '^font-' | grep -v '-tail$' | awk '{print $1}')

The above syntax works with bash.