Tyl*_*den 4 apt package-management
当我给出以下命令时:
apt-cache search git | wc -l
Run Code Online (Sandbox Code Playgroud)
我得到了 756 的答案。我如何只列出与 git 相关的六个左右的应用程序?
^...
)您可以像这样搜索以字符串“git”开头的条目。
$ apt-cache search ^git | head -10
git - fast, scalable, distributed revision control system
git-core - fast, scalable, distributed revision control system (obsolete)
git-doc - fast, scalable, distributed revision control system (documentation)
git-man - fast, scalable, distributed revision control system (manual pages)
gitk - fast, scalable, distributed revision control system (revision tree visualizer)
easygit - git for mere mortals
gforge-plugin-scmgit - Git plugin for FusionForge (transitional package)
git-all - fast, scalable, distributed revision control system (all subpackages)
git-annex - manage files with git, without checking their contents into git
git-arch - fast, scalable, distributed revision control system (arch interoperability)
Run Code Online (Sandbox Code Playgroud)
这与仅搜索字符串“git”有细微的差别,但不同之处在于此搜索将查找以字符串“git”开头的子字符串,而对“git”的裸词搜索将返回诸如“digital”之类的条目。
您还可以通过将输出apt-cache search ^git
通过管道传输到附加的grep
这样的方式来限制输出:
$ apt-cache search ^git | grep "^git" | head -10
git - fast, scalable, distributed revision control system
git-core - fast, scalable, distributed revision control system (obsolete)
git-doc - fast, scalable, distributed revision control system (documentation)
git-man - fast, scalable, distributed revision control system (manual pages)
gitk - fast, scalable, distributed revision control system (revision tree visualizer)
git-all - fast, scalable, distributed revision control system (all subpackages)
git-annex - manage files with git, without checking their contents into git
git-arch - fast, scalable, distributed revision control system (arch interoperability)
git-buildpackage - Suite to help with Debian packages in Git repositories
git-cola - highly caffeinated git GUI
Run Code Online (Sandbox Code Playgroud)
这将只显示名称以字符串“git”开头的包。
--names-only
这只会在包名称中搜索以字符串“git”开头的匹配项。
$ apt-cache search --names-only ^git | head -10
git - fast, scalable, distributed revision control system
git-core - fast, scalable, distributed revision control system (obsolete)
git-doc - fast, scalable, distributed revision control system (documentation)
git-man - fast, scalable, distributed revision control system (manual pages)
gitk - fast, scalable, distributed revision control system (revision tree visualizer)
git-all - fast, scalable, distributed revision control system (all subpackages)
git-annex - manage files with git, without checking their contents into git
git-arch - fast, scalable, distributed revision control system (arch interoperability)
git-buildpackage - Suite to help with Debian packages in Git repositories
git-cola - highly caffeinated git GUI
Run Code Online (Sandbox Code Playgroud)