Rehash command

After removing the application in the directory listed in the $PATH variable, you may even see the command prompt when you type the first characters:

  1. # pkg delete lsof
  2. Checking integrity... done (0 conflicting)
  3. Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):
  4. Installed packages to be REMOVED:
  5. lsof-4.90.b,8
  6. Proceed with deinstalling packages? [y/N]: y
  7. [1/1] Deinstalling lsof-4.90.b,8...
  8. [1/1] Deleting files for lsof-4.90.b,8: 100%
  9. # ls
  10. ls ls-F lsextattr lsof lspci lsvfs

While running it will prompt “Command not found.“ definitely:

  1. # lsof
  2. lsof: Command not found.

Np matter install or remove application , you need to run rehash command in csh to causes the shell to recompute a table of where commands are located.

Reference:
Misc Tips & Tricks;
Rehash.