Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I found the strangest thing

sudo cd $pwd
sudo: cd: command not found

I am able to cd as a normal user.It seems that PATH is not set properly for su.

How do I fix that?

share|improve this question

marked as duplicate by Avinash Raj, Maythux, chronitis, Jorge Castro, falconer Feb 11 '14 at 16:11

This question was marked as an exact duplicate of an existing question.

cd is not a program but an in-built command and sudo only applies to programs – Avinash Raj Feb 11 '14 at 6:34

You can't do cd like below,

sudo cd $pwd

But you can do,

sudo su
cd $pwd
share|improve this answer
sudo -i is the cleaner way of doing it. – frlan Feb 11 '14 at 8:12

You don't change directory as sudo.

sudo = Superuser Do [something]

what you can do is login as a superUser

sudo su

do what you want (change directory, execute, edite file, etc). eg:

cd [the_directory]

when you are done. logout superUser:


share|improve this answer
i think sudo means substitute user(rather than super user) – Meow Feb 11 '14 at 6:26
Instead of sudo su you should do sudo -i – frlan Feb 11 '14 at 8:11

thats because "cd" is a shell bullitin

don't worry it doesn't work for anyone

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.