NapoleonTheCake NapoleonTheCake - 1 year ago 88
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.


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download