What is the difference between
locate uses a previously built database to locate the file.
locate reads one or more databases prepared by
updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line.
Source locate(1) - Linux man page
updatedb creates or updates a database used by
locate(1). If the
database already exists, its data is reused to avoid rereading
directories that have not changed.
updatedb is usually run daily by
cron(8) to update the default
Source updatedb(8) - Linux man page
which looks for an executable file by searching for it in the directories in the
PATH environmental variable.
which takes one or more arguments. For each of its arguments it prints to
stdout the full path of the executables that would have been executed when this argument had been entered at the shell prompt. It does this by searching for an executable or script in the directories listed in the environment variable
using the same algorithm as
Source which(1) - Linux man page
locate mentor lists mentor, but
which mentor says "no mentor in..."
What does that mean?
You have some files named
mentor which can be found in the
You don't have an executable file or script named
mentor in your