歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu下查找程序的相關路徑

Ubuntu下查找程序的相關路徑

日期:2017/2/28 14:46:09   编辑:Linux教程

下面將介紹如何在快速定位Debian系統軟件的安裝路徑信息。

dpkg同樣被用於安裝、卸載和供給和.deb軟件包相關的信息。

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浏覽器的路徑

www.linuxidc.com @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

這樣我們就能找到具體的正確的包名了,然後就是利用包名查找地址:

www.linuxidc.com @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
以下省略部分結果

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved