Re: [問題]sudo 怎麼 cd?
※ 引述《sunkill.bbs@bbs.sayya.org (linux才是王道)》之銘言:
: 反而簡單的 cd 指令
: sudo cd /etc
: 沒辦法執行
: 好像是語法上悟認
: 請問該怎麼做?
: 感謝
stream [/home/cwhuang] -cwhuang- sudo cd /test
sudo: cd: command not found
stream [/home/cwhuang] -cwhuang- type cd
cd is a shell builtin
^^^^^^^^^^^^^^^^^^^^^
顯然,為什麼 command not found 很清楚.
另外你的需求可以用 "sudo sh" or "sudo -s" 來達成,
example: sudo sh -c "cd /somedir; do something"
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.248.58.236
→
12/05 23:33, , 1F
12/05 23:33, 1F
討論串 (同標題文章)