Further to Rena's answer, yes it is a function -- and you can replace it!
This link details how to do it. Fascinating post, actually. Just in time for April Fool's! sl command anyone?
Generously lifted from the linked article (for posterity) is this code snippet on placing this function in your .bashrc on an openSUSE platform:
command_not_found_handle() {
export TEXTDOMAIN=command-not-found
local cmd state rest
local -i pid ppid pgrp session tty_nr tpgid
# do not run when inside Midnight Commander or within a Pipe
if test -n "$MC_SID" -o ! -t 1 ; then
echo $"$1: command not found"
return 127
fi
# do not run when within a subshell
read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat
if test $$ -eq $tpgid ; then
echo "$1: command not found"
return 127
fi
# test for /usr/sbin and /sbin
if test -x "/usr/sbin/$1" -o -x "/sbin/$1" ; then
if test -x "/usr/sbin/$1" ; then prefix='/usr' ; else prefix='' ; fi
echo $"Absolute path to '$1' is '$prefix/sbin/$1', so running it may require superuser privileges (eg. root)."
return 127
fi
if test -n "$COMMAND_NOT_FOUND_AUTO" ; then
# call command-not-found directly
test -x /usr/bin/python && test -x /usr/bin/command-not-found && /usr/bin/python /usr/bin/command-not-found "$1" zypp
else
# print only info about command-not-found
echo -e $"If '$1' is not a typo you can use command-not-found to lookup the package that contains it, like this:\n cnf $1"
fi
return 127
}
/bin/bash? – Scott Mar 28 '11 at 7:25bash: asdf: command not found). – MattBianco Mar 28 '11 at 9:32