check if a program is installed
Find whether a command exists, where it is, and which package it came from.
Steps
-
command -v gitits path, or nothing if it is not there (use this in scripts)
-
type -a python3every python3 the shell can find, aliases and functions too
-
git --versionits version
-
dpkg -l | grep NAMEinstalled by apt? (Debian, Ubuntu)
-
apt policy NAMEinstalled and available versions
Notes
- lore shows every command it finds, and each page's VERSION says the package.
Commands used
commandtypedpkgapt
Each has a page in lore: lore command opens it.
Related recipes
- command not found after installingYou installed a program but the shell says "command not found": find where it went and let the shell see it.
- add a folder to the pathLet the shell find programs in a folder, for good, and reload the settings without logging out.
- add to the end of a fileAdd lines to a file without replacing it, also to a file only root can write.
- argument list too long"Argument list too long" from rm, cp or mv: too many files for one command line. Hand them over in batches.