Ubuntu下查找程序的相关路径

dpkg  is  a tool to install, build, remove and manage Debian packages.

主要使用以下这两个功能:

-L|--listfiles <package> ...    List files `owned' by package(s).

-l|--list [<pattern> ...]        List packages concisely.

例子:比如我们想查找chrome浏览器的路径

@Ubuntu:~/myscript$ dpkg -l | grep chrome

ii  google-chrome-stable                  22.0.1229.94-r161065                                The web browser from Google

ii  xserver-xorg-video-openchrome          1:0.2.904+svn1050-1ubuntu0.1                        X.Org X server -- VIA display driver

这样我们就能找到具体的正确的包名了,然后就是利用包名查找地址:

@ubuntu:~/myscript$ dpkg -L google-chrome-stable
/.
/usr
/usr/bin
/usr/share
/usr/share/applications
/usr/share/menu
/usr/share/menu/google-chrome.menu
/usr/share/gnome-control-center
/usr/share/gnome-control-center/default-apps
/usr/share/gnome-control-center/default-apps/google-chrome.xml
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/google-chrome.1
/usr/share/doc
/usr/share/doc/google-chrome
/usr/share/doc/google-chrome/changelog.gz
/etc
/etc/cron.daily
/etc/cron.daily/google-chrome
/opt
以下省略部分结果

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/19552.html