๐ 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.