我需要列出在UNIX/Linux中链接了指定共享库的程序(例如ldd,反之亦然) [英] I need to list the programs which have a specified shared library linked to them in UNIX/Linux (like ldd but vice versa)

查看:188
本文介绍了我需要列出在UNIX/Linux中链接了指定共享库的程序(例如ldd,反之亦然)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ldd命令列出了程序的所有动态链接的库.

ldd command in unix/linux lists all the dinamically linked libraries of a program.

如何确定相反的问题:
链接到指定共享库的程序列表是什么?

how can I determine the reverse question:
what is the list of programs linked to a specified shared library?

我需要一种获取使用"libz"的程序列表的方法.

I need a way of getting a list of programs that use "libz" for instance.

有命令吗?

推荐答案

我非常怀疑会不会出现这种情况.这将需要保留所有可执行文件的数据库,并记住它们所依赖的内容,如果仅从特定渠道安装软件,则可能会发生这种情况,但如果使用其他软件,则肯定无法跟踪您生成的可执行文件.更何况这样的数据库在很大程度上是无用的,因此没有吸引力.

I highly doubt there would be. That would require keeping a database of all executables and remembering what they depend on, which may be possible if you only install software from a specific channel, but it certainly won't be able to track executables you produce otherwise. Not to mention such a database is largely useless and therefore not attractive.

但是,如果您需要查找此类可执行文件(例如,知道删除共享库是否安全),则可以轻松找到其中的最多.关键是您拥有的大多数可执行文件都在/usr/bin/usr/local/bin或相似的位置内.因此,您需要在这些目录内的所有文件上运行ldd,并在要查找的库中运行grep.

If you need to find such executables however (e.g. to know if it's safe to remove the shared library), you can easily find most of them. The key is that most of the executables you have are inside /usr/bin or /usr/local/bin or similar locations. So all you need is to run ldd on all files inside those directories and grep for the library you are looking for.

这篇关于我需要列出在UNIX/Linux中链接了指定共享库的程序(例如ldd,反之亦然)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆