Linux命令之查看软件信息
whereis
,which
,dpkg -L
,dpkg -s
,apt show
,rpm -q{l|i|v}
命令提示符为root@hollowman-F117:~# :在优麒麟20.10/ubuntu20.10中以hollowman用户登录,打开终端后切换到root用户进行测试
命令提示符为[root@hollowman ~]# :在RHEL8/CentOS8中直接以root用户登录并进行测试
1.whereis
显示软件安装后有关文件的路径,前提是如果软件已经安装了的话。
一般来说,/usr/bin
表示执行文件(二进制文件)的路径,/usr/share
表示资源文件的路径
root@hollowman-F117:~# whereis ftp
ftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz
[root@hollowman ~]# whereis ftp
ftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz
2.which
显示软件安装后运行文件(二进制文件)的路径
root@hollowman-F117:~# which ftp
/usr/bin/ftp
[root@hollowman ~]# which ftp
/usr/bin/ftp
3.deb包相关查询
关于deb包详细信息,参考:https://blog.csdn.net/ymz641/article/details/112688551
1)dpkg -L
查看软件安装路径
root@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
2)dpkg -s
查看软件基本信息
root@hollowman-F117:~# dpkg -s ftp
Package: ftp
Status: install ok installed
Priority: standard
Section: net
Installed-Size: 138
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Source: netkit-ftp
Version: 0.17-34.1.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 <[email protected]>
3)apt show
查看软件基本信息
root@hollowman-F117:~# apt show ftp
Package: ftp
Version: 0.17-34.1.1
Priority: standard
Section: net
Source: netkit-ftp
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Mats Erik Andersson <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 141 kB
Depends: libc6 (>= 2.27), libreadline8 (>= 6.0), netbase
Replaces: netstd
Task: standard
Download-Size: 55.2 kB
APT-Manual-Installed: no
APT-Sources: http://mirrors.aliyun.com/ubuntu groovy/main amd64 Packages
Description: 经典文件传输客户端
这是 ARPANET 标准文件传输协议的用户界面。该程序可帮助用户和一个远程网络站点 之间交换文件。
4.rpm包相关查询
关于rpm包详细信息,参考https://blog.csdn.net/ymz641/article/details/111472917
1)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
2)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.
3)rpm -qv
查看软件包名
[root@hollowman ~]# rpm -qv ftp
ftp-0.17-78.el8.x86_64