The Wayback Machine - https://web.archive.org/web/20240118173739/https://www.geeksforgeeks.org/fc-list-command-in-linux-with-examples/
Open In App
Related Articles

fc-list command in Linux with examples

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

fc-list command is a part of the fontconfig system. It is used to list the available fonts and font styles. Using the format option, the list of all fonts can be filtered and sorted out. Moreover, multiple parameters can be passed to it after a colon symbol (:) to restrict the information that is being displayed on the screen.

Syntax:

fc-list [-vqVh] [-f FORMAT] [–verbose] [–format=FORMAT] [–quiet] [–version] [–help] [pattern] {element …} List fonts matching [pattern]

Example: It will print all the file locations of the font files present in the system, with their font name, spacing and style type.

fc-list

Options:

  • -v, –verbose: It is used to show the entire font pattern verbosely.
  • -f, –format=FORMAT: To use the given output format.
  • -q, –quiet: It will suppress all normal output, exit 1 if no fonts matched.
  • -V, –version: It will show font config version and exit.
  • -h, –help: Used to show the help message and exit.

Some More Examples:

  • fc-list with font-family: It will print only the names of the font families, without displaying the other aforementioned details.
    fc-list : family 

  • fc-list with font family + Language selector: It will print only the names of the font families which support the selected language code, without displaying the other aforementioned details.

    Note: The language code used here is “ta”, which stands for the language Tamil.

    fc-list : family lang=ta 

    Note: The language code used here is “hi”, which stands for the language Hindi.

    fc-list : family lang=hi

  • fc-list with other selectors: Similar to the family selector, we can also select the file location, spacing or/and style of the required fonts to be displayed onscreen.
    fc-list : family style 

    Note: Sorting and unique can also be incorporated along with this command

    fc-list : family spacing | sort | uniq

  • fc-list with format option: This option is used to format the output text to the required pattern given by the user. In this example, the format option is used to get the family names of all the fonts, sorted and unique.
    fc-list --format="%{family[0]}\n" | sort | uniq

Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 15 May, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials