Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why doesn't the whereis command give any information about the export command? How does the export command work even if the shell path variable is set to null?

share|improve this question
whereis is a nonstandard and not very useful command. type is better, because it is a builtin and should usually tell you how a command is resolved -- as a builtin, function, or non-builtin. Unfortunately POSIX has little to say about the details of type, so you have to check your shell's manual for what options it supports. whence is another command used by some shells and is similar to type. – ormaaj Dec 8 '12 at 16:12
up vote 10 down vote accepted

whereis doesn't show you a binary for export because it's a shell builtin. You can find it in the bash man page. As it's a builtin, not a binary, the shell doesn't search the PATH for it, so it will work regardless of the current path. Incidentally, this is why you are advised to use type to see what is being executed when you give a command:

$ which export
$ whereis export
$ type export
export is a shell builtin
share|improve this answer
@Kevin Where could I get information about built in export. What are the other built ins? – user3539 Dec 8 '12 at 15:54
If you look at man bash, you'll see probably see BASH BUILTIN COMMANDS near the top. – goldilocks Dec 8 '12 at 15:56
@user3539 you can see all the builtins in bash's man page, or the bash reference manual. – Kevin Dec 8 '12 at 15:57
For documentation about a specific bash command, use help: help export. Also, type -a shows you all the ways the command is found (alias/function/builtin/external) – glenn jackman Dec 8 '12 at 18:53
Locally, you can browse them via man bash-builtins – yuvilio Jan 2 '15 at 2:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.