Bash – What does “rm is hashed” mean

bashcommandshell

I'm going through http://mywiki.wooledge.org/BashGuide/CommandsAndArguments and came across this:

$ type rm
rm is hashed (/bin/rm)
$ type cd
cd is a shell builtin

Just a little earlier, the guide listed the various types of commands understood by Bash: aliases, functions, builtins, keywords and executables. But there wasn't mention of "hashed". So, in this context, what does "hashed" mean?

Best Answer

It's a performance thing; instead of searching the whole path for the binary every time it is called, it's put into a hash table for quicker lookup. So any binary that's already in this hash table, is hashed. If you move binaries around when they're already hashed, it will still try to call them in their old location.

See also help hash, or man bash and search for hash under builtin commands there.

Related Question