程序(命令)查询管理
1.which
定位某个程序(命令)的二进制文件
hollowman@hollowman-F117:~$ which man
/usr/bin/man
2.whereis
定位某个程序(命令)的二进制文件、源码和帮助页文件。
语法:whereis [选项] [-BMS <dir>... -f] <名称>
常用选项:
-b 只搜索二进制文件
-m 只搜索手册和信息
-s 只搜索源代码
实例:
hollowman@hollowman-F117:~$ whereis man
man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man7/man.7.gz /usr/share/man/man1/man.1.gz
hollowman@hollowman-F117:~$ whereis -b man
man: /usr/bin/man /usr/local/man /usr/share/man
3.dpkg
deb包管理命令
语法:dpkg [选项] 行为
选项
-i|--install <.deb 文件名> ... 安装软件
-r|--remove <软件包名> ... 卸载软件
-P|--purge <软件包名> ... 清除已安装或已删除的软件包
-V|--verify <软件包名> ... 检查包的完整性。
-s|--status <软件包名> ... 显示指定软件包的详细状态。
-p|--print-avail <软件包名> ... 显示可供安装的软件版本。
-L|--listfiles <软件包名> ... 列出属于指定软件包的文件。
-l|--list [<表达式> ...] 简明地列出软件包的状态。
-S|--search <表达式> ... 搜索含有指定文件的软件包。
3.dpkg -L <软件包名>
列出属于指定软件包的文件。
hollowman@hollowman-F117:~$ dpkg -L ftp
/.
/usr
/usr/bin
/usr/bin/netkit-ftp
/usr/share
/usr/share/doc
/usr/share/doc/ftp
/usr/share/doc/ftp/BUGS
/usr/share/doc/ftp/README.Debian
/usr/share/doc/ftp/changelog.Debian.gz
/usr/share/doc/ftp/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/netkit-ftp.1.gz
/usr/share/man/man5
/usr/share/man/man5/netkit-netrc.5.gz
4.dpkg -s <软件包名>
显示指定软件包的详细状态。
hollowman@hollowman-F117:~$ dpkg -s ftp
Package: ftp
Status: install ok installed
Priority: standard
Section: net
Installed-Size: 142
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: netkit-ftp
Version: 0.17-34.1
Replaces: netstd
Depends: libc6 (>= 2.27), libreadline8 (>= 6.0), netbase
Description: classical file transfer client
This is the user interface to the ARPANET standard File Transfer Protocol.
The program allows a user to transfer files to and from a remote network
site.
Original-Maintainer: Mats Erik Andersson <mats.andersson@gisladisker.se>
5.apt show <软件包名>
显示软件包细节
hollowman@hollowman-F117:~$ apt show ftp
Package: ftp
Version: 0.17-34.1
Priority: standard
Section: net
Source: netkit-ftp
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Mats Erik Andersson <mats.andersson@gisladisker.se>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 145 kB
Depends: libc6 (>= 2.27), libreadline8 (>= 6.0), netbase
Replaces: netstd
Task: standard
Download-Size: 56.7 kB
APT-Manual-Installed: yes
APT-Sources: http://mirrors.aliyun.com/ubuntu focal/main amd64 Packages
Description: 经典文件传输客户端
这是 ARPANET 标准文件传输协议的用户界面。该程序可帮助用户和一个远程网络站点 之间交换文件。
6.rpm -ql <软件包名>
查看软件安装路径
[root@hollowman ~]# rpm -ql ftp
/usr/bin/ftp
/usr/bin/pftp
/usr/lib/.build-id
/usr/lib/.build-id/fe
/usr/lib/.build-id/fe/93a289ddb32814099d9b6aec32dc566666bc8a
/usr/share/man/man1/ftp.1.gz
/usr/share/man/man1/pftp.1.gz
/usr/share/man/man5/netrc.5.gz
7.rpm -qi <软件包名>
查看程序基本信息
[root@hollowman ~]# rpm -qi ftp
Name : ftp
Version : 0.17
Release : 78.el8
Architecture: x86_64
Install Date: Fri 22 Jan 2021 05:13:46 AM CST
Group : Applications/Internet
Size : 114803
License : BSD with advertising
Signature : RSA/SHA256, Fri 14 Dec 2018 04:52:28 PM CST, Key ID 199e2f91fd431d51
Source RPM : ftp-0.17-78.el8.src.rpm
Build Date : Tue 11 Dec 2018 11:59:53 PM CST
Build Host : x86-vm-02.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor : Red Hat, Inc.
URL : ftp://ftp.linux.org.uk/pub/linux/Networking/netkit
Summary : The standard UNIX FTP (File Transfer Protocol) client
Description :
The ftp package provides the standard UNIX command-line FTP (File
Transfer Protocol) client. FTP is a widely used protocol for
transferring files over the Internet and for archiving files.
If your system is on a network, you should install ftp in order to do
file transfers.
8.rpm -qv**
查看软件包名
[root@hollowman ~]# rpm -qv ftp
ftp-0.17-78.el8.x86_64