Quand je donne la command suivante:
apt-cache search git | wc -l
J'obtiens la réponse 756. Comment puis-je listr seulement la demi-douzaine d'applications associées à git?
^...
) Vous pouvez simplement searchr des inputs commençant par la string "git" comme ceci.
$ apt-cache search ^git | head -10 git - fast, scalable, dissortingbuted revision control system git-core - fast, scalable, dissortingbuted revision control system (obsolete) git-doc - fast, scalable, dissortingbuted revision control system (documentation) git-man - fast, scalable, dissortingbuted revision control system (manual pages) gitk - fast, scalable, dissortingbuted revision control system (revision tree visualizer) easygit - git for mere mortals gforge-plugin-scmgit - Git plugin for FusionForge (transitional package) git-all - fast, scalable, dissortingbuted revision control system (all subpackages) git-annex - manage files with git, without checking their contents into git git-arch - fast, scalable, dissortingbuted revision control system (arch interoperability)
C'est une différence subtile par rapport à la search de la string "git", mais la différence est que cette search finda des sous-strings commençant par la string "git" alors qu'une search de mot de passe "git" renvoie des inputs telles que "digital".
Vous pouvez également limiter la sortie de apt-cache search ^git
en envoyant la sortie dans un grep
supplémentaire comme ceci:
$ apt-cache search ^git | grep "^git" | head -10 git - fast, scalable, dissortingbuted revision control system git-core - fast, scalable, dissortingbuted revision control system (obsolete) git-doc - fast, scalable, dissortingbuted revision control system (documentation) git-man - fast, scalable, dissortingbuted revision control system (manual pages) gitk - fast, scalable, dissortingbuted revision control system (revision tree visualizer) git-all - fast, scalable, dissortingbuted revision control system (all subpackages) git-annex - manage files with git, without checking their contents into git git-arch - fast, scalable, dissortingbuted revision control system (arch interoperability) git-buildpackage - Suite to help with Debian packages in Git repositories git-cola - highly caffeinated git GUI
Ce qui ne montrera que les packages dont le nom commence par la string "git".
--names-only
Cela ne fera que searchr les noms de packages pour les correspondances commençant par la string "git".
$ apt-cache search --names-only ^git | head -10 git - fast, scalable, dissortingbuted revision control system git-core - fast, scalable, dissortingbuted revision control system (obsolete) git-doc - fast, scalable, dissortingbuted revision control system (documentation) git-man - fast, scalable, dissortingbuted revision control system (manual pages) gitk - fast, scalable, dissortingbuted revision control system (revision tree visualizer) git-all - fast, scalable, dissortingbuted revision control system (all subpackages) git-annex - manage files with git, without checking their contents into git git-arch - fast, scalable, dissortingbuted revision control system (arch interoperability) git-buildpackage - Suite to help with Debian packages in Git repositories git-cola - highly caffeinated git GUI
Très probablement parce que ceci:
apt-cache show libqt5sensors5 | grep -i git Version: 5.0~git20130507-0ubuntu1~raring1~test1 WARNING: This module is not an official part of Qt 5, but instead a git Version: 5.0~git20130115-0ubuntu1 Filename: pool/universe/q/qtsensors-opensource-src/libqt5sensors5_5.0~git20130115-0ubuntu1_amd64.deb
Certains packages sont liés à "git", d'autres ont juste "git" quelque part dans la description, puisque apt-cache search
ne apt-cache search
pas seulement dans le nom des packages mais dans la description courte / longue.
Comment puis-je listr la demi-douzaine d'applications associées à git?
apt-cache search git | grep -i git
Cela vous montrera seulement les packages qui ont "git" dans la description courte ou le nom du package.