Ubuntu下查找程序的相關路徑
下面將介紹如何在快速定位Debian系統軟件的安裝路徑信息。
dpkg同樣被用於安裝、卸載和供給和.deb軟件包相關的信息。
[plain]
dpkg is a tool to install, build, remove and manage Debian packages.
主要使用以下這兩個功能:
[html]
-L|--listfiles <package> ... List files `owned' by package(s).
-l|--list [<pattern> ...] List packages concisely.
例子:比如我們想查找chrome浏覽器的路徑
[html]
androidyue@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
這樣我們就能找到具體的正確的包名了,然後就是利用包名查找地址:
[html]
androidyue@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