2 ms·
Good question, you can of course test this yourself with `time`. In the case of Bash, non-built-in commands are stored in a lookup table, exposed via the hash
by xyzzy_plugh 7y ago
Good question, you can of course test this yourself with `time`.
In the case of Bash, non-built-in commands are stored in a lookup table, exposed via the hash built-in (`help hash`). So, there should only be a one-time performance hit per shell instance.
Generally speaking, stat'ing hundreds of directories is surprisingly quick, most binaries do it all the time, when loading libraries for example. You can `strace` to see the numerous file tree crawls.