Location of cd executable

后端 未结 7 1391
独厮守ぢ
独厮守ぢ 2020-12-11 04:39

I read that the executables for the commands issued using exec() calls are supposed to be stored in directories that are part of the PATH variable.

Accordingly, I fo

相关标签:
7条回答
  • 2020-12-11 05:40

    cd is a shell built-in, unfortunately.

    $ type cd
    cd is a shell builtin
    

    ...from http://www.linuxquestions.org/questions/linux-newbie-8/whereis-cd-sudo-doesnt-find-cd-464767/

    But you should be able to get it working with:

    sh -c "cd /somedir; do something"
    
    0 讨论(0)
提交回复
热议问题