ソフトウェア情報を表示するLinuxコマンド
whereis
、which
、dpkg -L
、dpkg -s
、apt show
、rpm -q{l|i|v}
コマンドプロンプトはroot @ hollowman-F117:〜#:Ubuntu Kylin 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.どちらか
ソフトウェアのインストール後、実行中のファイル(バイナリファイル)のパスを表示します
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