The command itself (actually it's an executable Python script) lives in /usr/lib/
, which is not usually in a user's PATH
. But you can certainly run it if you wish, e.g.
$ /usr/lib/command-not-found cpufetch
Command 'cpufetch' not found, but can be installed with:
sudo snap install cpufetch # version 1.04, or
sudo apt install cpufetch # version 1.01+git20211208+40b13bc-2
See 'snap info cpufetch' for additional versions.
However it's typically run automagically by the bash shell, via its command_not_found_handle
hook function:
$ declare -f -p command_not_found_handle
command_not_found_handle ()
{
if [ -x /usr/lib/command-not-found ]; then
/usr/lib/command-not-found -- "$1";
return $?;
else
if [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/share/command-not-found/command-not-found -- "$1";
return $?;
else
printf "%s: command not found\n" "$1" 1>&2;
return 127;
fi;
fi
}