[root@MGWSDT_FEWS bin]# type cd
cd is a shell builtin
[root@MGWSDT_FEWS bin]# which cd
/usr/bin/which: no cd in (.:/usr/expect/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/real/RealPlayer:/root/bin)
它说因为 cd 是一个内置命令,所以“哪个 cd”失败了。
'pwd' 也是一个内置命令,为什么 'which pwd' 可以得到它的位置?
[root@MGWSDT_FEWS ~]# type pwd
pwd is a shell builtin
[root@MGWSDT_FEWS ~]# which pwd
/bin/pwd