Shared object files streamline programs by providing information applications need to do their jobs, but that don't have to be part of the application itself. To find out which of these files a Linux command calls on, use the ldd command.\nWhat is a shared object file?\nShared object files (designated as .so) are\u00a0libraries that are automatically linked into a program when the program starts, yet exist as a standalone\u00a0files. They contain information that can be used by one or more programs to offload resources so that any program calling a .so file doesn't itself have to actually provide all the needed tools. These files can be linked to any program and be loaded anywhere in memory.\nA single .so file might contain information and functions on how to quickly search through the whole computer or perform very complex calculations. Several programs can then call upon that .so file. In fact, .so files can be updated\/replaced without those programs having to make any changes to their own code.\nShared libraries can be linked to any program at run-time. Think of them as chunks of code that can be used by many different programs, thus allowing those programs to be smaller and much more efficient than ensuring all the programs that use them contain them and get updated as needed if the code changes.\nUsing ldd\nThis simple example uses ldd to find out what files the date command uses:\n$ ldd \/usr\/bin\/date\n linux-vdso.so.1 (0x00007ffd230e5000)\n libc.so.6 => \/lib64\/libc.so.6 (0x00007f8e9fc54000)\n \/lib64\/ld-linux-x86-64.so.2 (0x00007f8e9fe52000)\n\nThe result above shows that the date command uses three shared object files.\nNote that you have to include a full pathname to the file when using ldd. Otherwise, ldd looks into the current directory for the program name and isn't likely to find it.\n$ ldd date\nldd: .\/date: No such file or directory\n\nIf you're not sure where a particular program is located, you can use the which command in either of the forms shown below.\n$ which pwd\n\/usr\/bin\/pwd\n$ ldd \/usr\/bin\/pwd\n linux-vdso.so.1 (0x00007ffe9df9b000)\n libc.so.6 => \/lib64\/libc.so.6 (0x00007f686d670000)\n \/lib64\/ld-linux-x86-64.so.2 (0x00007f686d85d000)\n\nor\n$ ldd `which pwd`\n linux-vdso.so.1 (0x00007ffc3b9e4000)\n libc.so.6 => \/lib64\/libc.so.6 (0x00007f2d491a9000)\n \/lib64\/ld-linux-x86-64.so.2 (0x00007f2d49396000)\n\nYou can get a lot more information by using the -v (or --verbose) option:\n$ ldd -v `which pwd`\n linux-vdso.so.1 (0x00007ffeea1f6000)\n libc.so.6 => \/lib64\/libc.so.6 (0x00007ff3b0c64000)\n \/lib64\/ld-linux-x86-64.so.2 (0x00007ff3b0e51000)\n\n Version information:\n \/usr\/bin\/pwd:\n libc.so.6 (GLIBC_2.3) => \/lib64\/libc.so.6\n libc.so.6 (GLIBC_2.14) => \/lib64\/libc.so.6\n libc.so.6 (GLIBC_2.3.4) => \/lib64\/libc.so.6\n libc.so.6 (GLIBC_2.33) => \/lib64\/libc.so.6\n libc.so.6 (GLIBC_2.4) => \/lib64\/libc.so.6\n libc.so.6 (GLIBC_2.2.5) => \/lib64\/libc.so.6\n \/lib64\/libc.so.6:\n ld-linux-x86-64.so.2 (GLIBC_2.2.5) => \/lib64\/ld-linux-x86-64.so.2\n ld-linux-x86-64.so.2 (GLIBC_2.3) => \/lib64\/ld-linux-x86-64.so.2\n ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => \/lib64\/ld-linux-x86-64.so.2\n\nThe ldd command is sometimes used when it appears that a needed shared library is missing, and instead a "not found" message is generated. For example:\n libcsfml-graphics.so.2.2 => not found\n\nIf many or all of the needed libraries are missing, you might actually be missing a configuration file or symbolic link meant to make the connection. Missing shared object files are very uncommon, and you are unlikely to ever run into this problem.\nSome programs use only a few shared libraries while others use a pile of them. Take a look at the reboot command and you will see a very long list of files like this:\n$ ldd \/usr\/sbin\/reboot\n linux-vdso.so.1 (0x00007ffd0b374000)\n libsystemd-shared-249.so => \/usr\/lib\/systemd\/libsystemd-shared-249.so (0x00007f30fbec3000)\n libgcc_s.so.1 => \/lib64\/libgcc_s.so.1 (0x00007f30fbe9a000)\n libc.so.6 => \/lib64\/libc.so.6 (0x00007f30fbc90000)\n libacl.so.1 => \/lib64\/libacl.so.1 (0x00007f30fbc85000)\n libblkid.so.1 => \/lib64\/libblkid.so.1 (0x00007f30fbc4d000)\n libcap.so.2 => \/lib64\/libcap.so.2 (0x00007f30fbc43000)\n libcrypt.so.2 => \/lib64\/libcrypt.so.2 (0x00007f30fbc07000)\n libgcrypt.so.20 => \/lib64\/libgcrypt.so.20 (0x00007f30fbacb000)\n libip4tc.so.2 => \/lib64\/libip4tc.so.2 (0x00007f30fbac1000)\n libkmod.so.2 => \/lib64\/libkmod.so.2 (0x00007f30fbaa6000)\n liblz4.so.1 => \/lib64\/liblz4.so.1 (0x00007f30fba82000)\n libmount.so.1 => \/lib64\/libmount.so.1 (0x00007f30fba3d000)\n libcrypto.so.1.1 => \/lib64\/libcrypto.so.1.1 (0x00007f30fb74d000)\n libp11-kit.so.0 => \/lib64\/libp11-kit.so.0 (0x00007f30fb61b000)\n libpam.so.0 => \/lib64\/libpam.so.0 (0x00007f30fb609000)\n libseccomp.so.2 => \/lib64\/libseccomp.so.2 (0x00007f30fb5e8000)\n libselinux.so.1 => \/lib64\/libselinux.so.1 (0x00007f30fb5bc000)\n libzstd.so.1 => \/lib64\/libzstd.so.1 (0x00007f30fb4c6000)\n liblzma.so.5 => \/lib64\/liblzma.so.5 (0x00007f30fb498000)\n \/lib64\/ld-linux-x86-64.so.2 (0x00007f30fc216000)\n libattr.so.1 => \/lib64\/libattr.so.1 (0x00007f30fb490000)\n libgpg-error.so.0 => \/lib64\/libgpg-error.so.0 (0x00007f30fb46a000)\n libpcap.so.1 => \/lib64\/libpcap.so.1 (0x00007f30fb41d000)\n libz.so.1 => \/lib64\/libz.so.1 (0x00007f30fb403000)\n libffi.so.6 => \/lib64\/libffi.so.6 (0x00007f30fb3f6000)\n libaudit.so.1 => \/lib64\/libaudit.so.1 (0x00007f30fb3c8000)\n libeconf.so.0 => \/lib64\/libeconf.so.0 (0x00007f30fb3bd000)\n libm.so.6 => \/lib64\/libm.so.6 (0x00007f30fb2e1000)\n libpcre2-8.so.0 => \/lib64\/libpcre2-8.so.0 (0x00007f30fb24a000)\n libibverbs.so.1 => \/lib64\/libibverbs.so.1 (0x00007f30fb228000)\n libcap-ng.so.0 => \/lib64\/libcap-ng.so.0 (0x00007f30fb21d000)\n libnl-route-3.so.200 => \/lib64\/libnl-route-3.so.200 (0x00007f30fb197000)\n libnl-3.so.200 => \/lib64\/libnl-3.so.200 (0x00007f30fb173000)\n\nOf course, what this output doesn't tell you is how many programs use these shared libraries and how much trouble you would have if one of the more important ones was removed from your system. Even common commands could stop working.\nDon't be fooled. Likely every command that you enter on a Linux system is using shared libraries. Even as modest a command as echo uses several:\n$ ldd \/usr\/bin\/echo\n linux-vdso.so.1 (0x00007ffdbf99d000)\n libc.so.6 => \/lib64\/libc.so.6 (0x00007f0696277000)\n \/lib64\/ld-linux-x86-64.so.2 (0x00007f069649c000)\n\nThe criticality of these files is quite obvious. Fortunately, it's easy to appreciate them, but otherwise let them do their thing. There's no way to peer into them or inquire about how they work. You can display some details like those shown below, but this doesn't provide much insight the functions the files provide.\n$ ls -l \/lib64\/libc.so.6\n-rwxr-xr-x. 1 root root 2387984 Oct 1 14:19 \/lib64\/libc.so.6\n$ file \/lib64\/libc.so.6\n\/lib64\/libc.so.6: ELF 64-bit LSB shared object, x86-64, version 1 (GNU\/Linux),dynamically linked, interpreter lib64\/ld-linux-x86-64.so.2, BuildID[sha1]=f891252f9069edee265f92cfb9a163880999588b, for GNU\/Linux 3.2.0, not stripped\n\nWrap-Up\nShared object files are an extremely important part of any Linux system as they allow programs to share resources that can be updated and loaded into memory separately. It's easy to determine what shared object files any particular command uses, but virtually impossible to determine the roles that they are playing.