Bash PATH和哪个命令

我刚刚在〜/ local / bin /中在本地安装了sed的检测版本-但是,我很惊讶地看到以下内容:

sed --version
sed (GNU sed) 4.7
Packaged by Debian

`which sed` --version
 /home/xxx/local/bin/sed (GNU sed) 4.8
 Copyright (C) 2020 Free Software Foundation, Inc.

What is causing which to return a path which is not the path actually used by bash when issuing the command ? Or am I making a giant mistake somewhere ?