Well I did search through AskUbuntu and found some threads where people are asking about how can they install multiple fonts at once? I know the process. I have to copy-paste all the fonts, .ttf/.otf files inside of .font hidden folder and then rebuild the font cash via this command...

fc-cache -rv

This is crystal clear. I just want to know this...

I downloaded 10+ .zip font files. When I extracted the .zip folders I see within each folder there are couple of files. A readme file, a .ttf/.otf file and in some cases some variants of the fonts. Like bold.ttf, ultra_bold.ttf, semi_bold.ttf, black.ttf etc. I am not sure what these additional files are but I guess these are mainly variants of the core fonts. However my question is...

Do I need to extract all the .zip files manually and then copy only .ttf/.otf files and then paste them manually in .font folder? Or I can use a terminal command which will do everything on behalf of me. Here by the word everything I meant...

  1. Extracting the .zip files
  2. Copying only .ttf/.otf files
  3. Pasting only the .ttf/.otf files into .font folder
  4. Finally installing the .ttf/.otf files in Ubuntu

Sorry for asking a broad question. But to avoid down votes I had to make sure I am not asking anything which is asked before. And thanks in advanced for all your helps.


This is a one-liner in a terminal. Open a terminal with Ctr+Alt+T and run the commands below. Replace <your_font_zips> with the folder name, where you have placed your zip font files.

cd <your_font_zips>
# next command extracts all TTF and OTF files into your `.fonts` folder.
unzip "*.zip" "*.ttf" "*.otf" -d ${HOME}/.fonts
# next command rebuilds font cache
sudo fc-cache -f -v

If you want to remove the fonts again, then simply delete the TTF files in your .fonts folder and rebuild the font cache.

More about fonts and Ubuntu here.

And yes, you need all TTF files.

TTF and/or OTF

I quote:

OTF is more likely to be a “better” font, as it supports more advanced typesetting features (smallcaps, alternates, ligatures and so on actually inside the font rather than in fiddly separate expert set fonts). It can also contain either spline (TTF-style) or Bezier (PostScript Type 1-style) curves, so hopefully you're getting the shapes the font was originally designed in and not a potentially-poorer-quality conversion.


  • You put a different command few minutes ago! You mean I should run this one "unzip ".zip" ".ttf" "*.otf" -d ${HOME}/.fonts; sudo fc-cache -f -v" instead of the one you gave few minutes ago? – Roy Emmarson May 6 '15 at 14:46
  • 1
    Yes, this is the final tested version =) – A.B. May 6 '15 at 14:52
  • We don't need the find – A.B. May 6 '15 at 14:52
  • don't forget to change the directory – A.B. May 6 '15 at 14:53
  • sorry for the typo... Well I have 3 parallel questions... 1- Lets say I want to delete some fonts from system. How can I do so? 2- I don't know much about scripting. From your words what I understand is I can open a file in the font folder and then copy paste the commands you supplied. And then I should run the file with font archives. Following this I opened a gedit file in the font folder where .zip files are then copycat your commands within the file. But now how can I run the file using font archive? I don't see any application named font archive rather an app named archive manager – Roy Emmarson May 6 '15 at 15:10

Not a one liner but here is slightly more robust script that works on Linux as well as OSX. Here we download codefonts and install it without overwriting existing files.

#fail if any errors
set -e
set -o xtrace

wget -P ${temp_dir} https://github.com/chrissimpkins/codeface/releases/download/font-collection/codeface-fonts.zip

if test "$(uname)" = "Darwin" ; then
  # MacOS
  # Linux
  mkdir -p $fonts_dir

# -n option avoids overwriting
set +e
unzip -n ${temp_dir}/codeface-fonts.zip "fonts/*.ttf" "fonts/*.otf" "*fonts/.pcf.gz" -d ${temp_dir}
set -e
cp -rnv ${temp_dir}/fonts ${fonts_dir}

if test "$(uname)" = "Darwin" ; then
  # Copy SF Mono for MacOS
  cp /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/*.otf "$fonts_dir/"

# Reset font cache on Linux
if which fc-cache >/dev/null 2>&1 ; then
    echo "Resetting font cache, this may take a moment..."
    fc-cache -f "$fonts_dir"

echo "codefonts installed to $fonts_dir"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.