whereis ls 和whereis cd 的结果是一样的,都有执行命令,帮助文件的位置,但是help cd有结果,help ls无结果,具体看下面的命令

来源:5-2 Linux中 其他帮助命令

雪域苍狼

2019-01-14 14:59

[root@VM_0_14_centos ~]# whereis ls      /////////查找ls,存在执行文件位置以及帮助文件位置

ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz

[root@VM_0_14_centos ~]# whereis cd   ///////查找 cd,一样的结果

cd: /usr/bin/cd /usr/share/man/man1/cd.1.gz

[root@VM_0_14_centos ~]# man cd


[6]+  Stopped                 man cd

[root@VM_0_14_centos ~]# man cd 


[7]+  Stopped                 man cd

[root@VM_0_14_centos ~]# help cd   ///////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.

[root@VM_0_14_centos ~]# help ls   //////help ls,无结果

-bash: help: no help topics match `ls'.  Try `help help' or `man -k ls' or `info ls'.

疑问:为什么help cd有结果,whereis cd的结果于whereis ls 的结果是一样的

写回答 关注

4回答

  • 慕莱坞2534779
    2020-02-18 11:27:22

    我的是6.3,没有这个问题

  • 慕村8302692
    2019-05-15 14:09:58

    你可以man ls ,ls不是内置命令所以help查找不到的

  • night_尘
    2019-01-25 10:16:11

    可以用“type 命令”来看,更直观。

    别问为什么,我也是centOs7.

  • 小何
    2019-01-14 16:08:53

    CentOS7把cd也放进bin目录里了

Linux达人养成计划 I

Linux入门视频教程,以通俗易懂的语言带你感受linux之美

399344 学习 · 3791 问题

查看课程

相似问题