←back to thread

185 points thunderbong | 1 comments | | HN request time: 0.001s | source
Show context
lelandfe ◴[] No.43647389[source]
> Since I never remember which one is which, a good way to check is using the utility `file`: `file $(which useradd)`

While we're here, can someone explain why `which` prints some locations, and for others the whole darn file? Like `which npm` prints the location; `which nvm` prints the whole darn file.

replies(5): >>43647452 #>>43647455 #>>43647461 #>>43647472 #>>43648647 #
1. adrianmonk ◴[] No.43648647[source]
For this situation, in bash, use 'type nvm' (instead of 'which nvm' or 'file nvm'). It will tell you what 'nvm' is (executable, shell alias, shell function, shell builtin, etc.), which will probably solve the mystery.