←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. cstrahan ◴[] No.43647472[source]
Are you sure that what is being printed is the contents of a file? And which shell are you using?

If your which command is a shell builtin, and nvm is a function, then you’re likely seeing the content of that function.