Debian/Ubuntu:apt 文件查找/搜索之间的差异

Debian/Ubuntu:apt 文件查找/搜索之间的差异

这两个命令之间有实际区别吗?

/home/pkaramol/Desktop
$ sudo apt-file search logrotate.conf
logrotate: /etc/logrotate.conf
logrotate: /usr/share/man/man5/logrotate.conf.5.gz
petitboot: /etc/logrotate.d/petitboot/logrotate.conf
rsync: /usr/share/doc/rsync/examples/logrotate.conf.rsync
unicorn: /usr/share/doc/unicorn/examples/logrotate.conf

/home/pkaramol/Desktop
$ sudo apt-file find logrotate.conf
logrotate: /etc/logrotate.conf
logrotate: /usr/share/man/man5/logrotate.conf.5.gz
petitboot: /etc/logrotate.d/petitboot/logrotate.conf
rsync: /usr/share/doc/rsync/examples/logrotate.conf.rsync
unicorn: /usr/share/doc/unicorn/examples/logrotate.conf
/home/pkaramol/Desktop/centos_7

根据帮助:

search|find 搜索包中的文件

答案1

man apt-file

search

       Search in which package a file is included. A list of all packages
       containing the pattern pattern is returned.

       Since Contents files does not contain directories, the pattern must
       match (part of a) file name.

       By default, the search action interprets its pattern as if
       --substring-match was specified.

并且find

Alias for search.

所以两者是相同的。

相关内容