freelocale - Linux


Overview

freelocale is a command-line utility for inspecting and manipulating locale settings. It’s commonly used to set and display various locale-related variables, such as language, currency, and date/time formats.

Syntax

freelocale [options] [locale_name]

Options/Flags

  • -l, --list: List available locales.
  • -s, --set: Set the default locale.
  • -e, --environment: Print the locale settings in environment format.
  • -V, --version: Display version information.
  • -h, --help: Print help and usage information.

Examples

  • Get the current default locale:

    $ freelocale
    
  • Set the default locale to French (France):

    $ freelocale -s fr_FR
    
  • List all available locales:

    $ freelocale -l
    
  • Get locale settings in environment format:

    $ freelocale -e
    

Common Issues

  • Missing locale: If a specified locale is not installed on the system, freelocale will report an error.
  • Invalid locale: Locale names must follow the ISO 639-1 language code and ISO 3166-1 country code format, e.g. en_US or fr_FR.

Integration

freelocale can be integrated with other commands to set locale-specific environment variables, such as:

export LANG=$(freelocale)

Related Commands

  • locale: Set and display locale settings, similar to freelocale but with a wider range of options.
  • localectl: Manage locale settings from the command line, part of the systemd init system.