man手册问题

46 views
Skip to first unread message

张释文

unread,
May 24, 2012, 12:47:08 AM5/24/12
to 西邮Linux兴趣小组

为什么man手册里面没有cd...


shiwen@linux:~$ man cd
没有 cd 的手册页条目

Amos Kong

unread,
May 24, 2012, 1:24:48 AM5/24/12
to 张释文, 西邮Linux兴趣小组
2012/5/24 张释文 <shi.s...@gmail.com>:
>
> 为什么man手册里面没有cd...

cd 属于shell内部命令,编译在shell程序里的
# man bash

类似的还有 alias, bg, bind, break, builtin, caller, cd, command, compgen,
complete, compopt, continue, declare, dirs, disown, echo, enable,
eval,
exec, exit, export, false, fc, fg, getopts, hash, help,
history, jobs, kill, let, local, logout, mapfile, popd, printf,
pushd, pwd, read, readonly,
return, set, shift, shopt, source, suspend, test, times,
trap, true, type, typeset, ulimit, umask, unalias, unset, wait


> shiwen@linux:~$ man cd
> 没有 cd 的手册页条目
>
> --
> 要退订此论坛请发邮件至 xiyoulinux-...@googlegroups.com
> 更多选项: http://groups.google.com/group/xiyoulinux?hl=zh-CN
> 提问前建议您阅读:http://www.xiyoulinux.cn/blog/?p=64
> 也请查看我们的FAQ:http://xiyoulinux.cn/wiki/index.php?title=FAQ

Cong Wang

unread,
May 24, 2012, 1:26:58 AM5/24/12
to 张释文, 西邮Linux兴趣小组
2012/5/24 张释文 <shi.s...@gmail.com>:
>     shiwen@linux:~$ man cd
>    没有 cd 的手册页条目

bash-4.2$ help cd
cd: cd [-L|[-P [-e]]] [dir]
Change the shell working directory.

Change the current directory to DIR. The default DIR is the value of the
HOME shell variable.

The variable CDPATH defines the search path for the directory containing
DIR. Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory. If DIR begins
with a slash (/), then CDPATH is not used.

If the directory is not found, and the shell option `cdable_vars' is set,
the word is assumed to be a variable name. If that variable has a value,
its value is used for DIR.

Options:
-L force symbolic links to be followed
-P use the physical directory structure without following symbolic
links
-e if the -P option is supplied, and the current working directory
cannot be determined successfully, exit with a non-zero status

The default is to follow symbolic links, as if `-L' were specified.

Exit Status:
Returns 0 if the directory is changed, and if $PWD is set successfully when
-P is used; non-zero otherwise.
Reply all
Reply to author
Forward
0 new messages