Bug 958055

Summary: which command does not find cd command
Product: [openSUSE] openSUSE Distribution Reporter: Forgotten User SpTvqxsYZX <forgotten_SpTvqxsYZX>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bwiedemann
Version: Leap 42.1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User SpTvqxsYZX 2015-12-05 01:25:16 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Build Identifier: 

When using sudo cd command, sudo says that cd cannot be found, then when using "which cd" command, it says that it is also unable to find cd. 

Reproducible: Always

Actual Results:  
cd not found

Expected Results:  
sudo should be able to find built in commands
Comment 1 Bernhard Wiedemann 2015-12-05 12:43:27 UTC
There is no "cd" binary
because changing directory only affects the running process
Thus "sudo cd" does not make sense.

Instead you probably want to do something like
sudo bash -c "cd /root ; ls"
or
su - root -c "cd /root ; ls"