2

I was just playing around with the whatis command. For some reason, whenever I run whatis cd, I get cd: nothing appropriate. What does this mean? Why is this? It seems there is no man entry for cd either. Why is that?

2
  • 1
    That could mean that cd is not implemented as a seperate executable. Try man sh, and then search for a description of the cd command under the Builtins section.
    – sawdust
    Commented Sep 28, 2019 at 1:20
  • 2
    That's not a very good duplicate of this question. Maybe it's not even a good enough duplicate of this question.
    – karel
    Commented Sep 28, 2019 at 7:17

2 Answers 2

4

cd is a builtin shell command:

$ type cd
cd is a shell builtin

The documentation for cd can be found with:

man builtins

Run it then press / and search for "cd".

In Bash you can also open a help page with:

help cd
0

whatis displays one line of information from the man page of the command (the one you find in the NAME section).

nothing appropriate is displayed when no man page is found for that command.

cd has no man page of its own because it is not an executable but a built-in of your shell (like shopt or alias for instance)(*), hence the result you get.

(*) To make the matter a bit more complex there are plain commands such as echo and printf that are overridden by like-named (and usually upward compatible) shell built-ins, so these built-ins appear to have their own man page, but the man page is really for the executable (which could have slightly different parameters).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .