Detailed Explanation of the Linux Subdirectory /usr/share

๐Ÿ“‚ Linux Subdirectory <strong><span>/usr/share</span></strong> Detailed Explanation

๐Ÿ“Œ 1. Overview

<span><span>/usr/share</span></span> is the directory in the Linux system used to store architecture-independent shared data. This data includes manuals, documentation, configuration templates, fonts, icons, internationalization resources (localization files), etc. Regardless of whether the system architecture is x86, ARM, or other platforms, these data files are the same across all architectures.

๐Ÿ“ 2. Directory Structure and Content of /usr/share

/usr/share/โ”œโ”€โ”€ applications      # .desktop files for applications, used by desktop environmentsโ”œโ”€โ”€ doc               # Documentation and help files for the system or softwareโ”œโ”€โ”€ icons             # System icon resources, commonly used in desktop environmentsโ”œโ”€โ”€ locale            # Internationalization resources directory (language translation files, etc.)โ”œโ”€โ”€ man               # Manual page files (see /usr/share/man)โ”œโ”€โ”€ misc              # Miscellaneous files (see /usr/share/misc)โ”œโ”€โ”€ fonts             # Font filesโ”œโ”€โ”€ pixmaps           # Icon or image resources, usually in xpm formatโ”œโ”€โ”€ themes            # Theme resources for desktop environmentsโ”œโ”€โ”€ zoneinfo          # Time zone information filesโ”œโ”€โ”€ dict              # Dictionary data (e.g., `/usr/share/dict/words`)โ”œโ”€โ”€ licenses          # License informationโ”œโ”€โ”€ sounds            # Sound filesโ””โ”€โ”€ ...               # Other directories created by software or tools

๐Ÿ” 3. Common Subdirectory Details

๐Ÿ“ 1. /usr/share/applications
  • Used to store <span><span>.desktop</span></span> files that define how desktop applications are launched, including their icons, names, etc.

  • The desktop environment (such as GNOME, KDE) scans this directory to generate application menus.

Example:

ls /usr/share/applications/
firefox.desktop  gedit.desktop  nautilus.desktop  ...
๐Ÿ“ 2. /usr/share/doc
  • Stores documentation for the system or software packages, including <span><span>README</span></span>, <span><span>LICENSE</span></span>, <span><span>CHANGELOG</span></span>, etc.

  • Each software package typically has a separate directory.

Example:

ls /usr/share/doc/
bash/  coreutils/  grep/  openssl/  python3/  ...
๐Ÿ“ 3. /usr/share/icons
  • Stores system icons, including desktop icons, file type icons, etc.

  • Commonly used in GNOME, KDE, and other desktop environments.

Example:

ls /usr/share/icons/
Adwaita/  hicolor/  Papirus/  ...
๐Ÿ“ 4. /usr/share/locale
  • Stores internationalization (i18n) resource files that support multilingual translations.

  • Classified by language or region codes.

Example:

ls /usr/share/locale/
en_US/  zh_CN/  fr_FR/  ja_JP/  ...
๐Ÿ“ 5. /usr/share/man
  • Stores system manual page files, categorized by sections.

  • Common meanings of each section:

    • 1: User commands

    • 2: System calls

    • 3: Library functions

    • 4: Special files (e.g., devices)

    • 5: Configuration file formats

    • 6: Games

    • 7: Miscellaneous (e.g., protocols, standards, etc.)

    • 8: System administration commands

Example:

ls /usr/share/man/man1/
ls.1.gz  grep.1.gz  bash.1.gz  ...
๐Ÿ“ 6. /usr/share/fonts
  • Stores font files available to the system.

  • Supports various font formats: <span><span>.ttf</span></span>, <span><span>.otf</span></span>, <span><span>.pcf</span></span>, etc.

Example:

ls /usr/share/fonts/
truetype/  opentype/  Type1/  ...
๐Ÿ“ 7. /usr/share/zoneinfo
  • Stores time zone information files.

  • Applications (such as <span><span>date</span></span>, <span><span>timedatectl</span></span>) read time zone data from here.

Example:

ls /usr/share/zoneinfo/
Africa/  America/  Asia/  Europe/  UTC  ...
๐Ÿ“ 8. /usr/share/misc

See: <span><span>/usr/share/misc Detailed Explanation</span></span> section. Includes <span><span>magic</span></span> files, <span><span>ascii</span></span> files, <span><span>pci.ids</span></span>, etc.

๐Ÿ› ๏ธ 4. Application Scenarios and Usage Examples

Directory Usage and Application Examples
<span><span>/usr/share/applications</span></span> Desktop environment menu generation, launch icon configuration.
<span><span>/usr/share/doc</span></span> View help documentation for software packages:<span><span>less /usr/share/doc/bash/README</span></span>
<span><span>/usr/share/locale</span></span> Internationalization support for systems or applications.
<span><span>/usr/share/icons</span></span> Install and change icon themes.
<span><span>/usr/share/fonts</span></span> Install new fonts.
<span><span>/usr/share/zoneinfo</span></span> Time zone settings:<span><span>ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</span></span>
<span><span>/usr/share/misc</span></span> <span><span>file</span></span> command uses the <span><span>magic</span></span> file, etc.

โœ… 5. Conclusion

  • <span><span>/usr/share</span></span> is the directory used to store shared data that is independent of hardware architecture.

  • It contains various data resources related to systems and software tools, such as manuals, fonts, icons, themes, language translations, etc..

  • Different distributions may create additional subdirectories under this directory to meet system needs.

  • Unlike <span><span>/usr/lib</span></span>, <span><span>/usr/share</span></span> primarily stores static data files, rather than program libraries or executable files.

Leave a Comment