ldconfig 和 modprobe 有什么不同

What's different for ldconfig & modprobe

当我按照 CentOS 中的 zfs 安装指南进行操作时

我发现它应该在完成源构建后使用 ldconfig

但是当我使用zfs命令时,它告诉我,我应该输入命令:/sbin/modprobe zfs

所以,我想知道 ldconfigmodprobe 有什么不同,是用户 space 进程的 ldconfig 和内核 space 进程的 modprobe 吗?

ldconfigmodprobe 是两个截然不同的程序

ldconfig 实质上缓存了所有共享库,因此当程序在 运行 时需要它时,它不必搜索文件系统来查找共享库。来自手册页:

ldconfig  creates  the  necessary links and cache to the most recent shared 
libraries found in the directories specified on the command line...

The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks 
the header and filenames of the libraries it encounters when determining which 
versions should have their links updated.

modprobe 在 linux 内核中添加或删除模块。模块几乎是可以插入内核和从内核中取出的代码片段。

is it ldconfig for user space process & modprobe for kernel space process?

运行 时间程序使用共享库,而模块是可移动的内核代码片段。