Forrest logo
tool overview
On this page you find all important commands for the CLI tool ldconfig. If the command you are looking for is missing please ask our AI.

ldconfig

ldconfig is a command line tool used in Unix-like operating systems to update the shared library cache. The purpose of this tool is to maintain a cache of the shared libraries available on a system, making it easier and faster for programs to locate and link against these libraries. This cache is stored in the file /etc/ld.so.cache.

The ldconfig tool scans specific directories defined in the file /etc/ld.so.conf, as well as the trusted directories mentioned in the ld.so.conf.d directory, to locate shared libraries. It then updates the cache with information about these libraries, including their names, paths, and version numbers.

Using ldconfig, system administrators can manage the shared library cache by adding, removing, or modifying the library entries. This is particularly useful when installing new libraries or updating existing ones.

The ldconfig command is typically executed when a new library is installed or modified to ensure that the changes are reflected in the shared library cache. It helps prevent symbolic link issues and enables programs to find and load the correct libraries at runtime.

Additionally, ldconfig provides options for controlling the behavior of the command, such as specifying an alternate library path, suppressing error messages, or only printing the library cache without updating it.

List of commands for ldconfig:

  • ldconfig:tldr:5e846 ldconfig: Update symlinks and rebuild the cache (usually run when a new library is installed).
    $ sudo ldconfig
    try on your machine
    explain this command
  • ldconfig:tldr:6d2d4 ldconfig: Update the symlinks for a given directory.
    $ sudo ldconfig -n ${path-to-directory}
    try on your machine
    explain this command
  • ldconfig:tldr:f46e9 ldconfig: Print the libraries in the cache and check whether a given library is present.
    $ ldconfig -p | grep ${library_name}
    try on your machine
    explain this command
tool overview