Skip to main content
Specified in title because this is only shell buitlin case
Link

Trouble with running cd with sudo as another user

Source Link
Vombat
  • 13.3k
  • 14
  • 47
  • 58

sudo as another user

I want to run a command on a shell on behalf of another user. The command is as follows:

sudo -u USER cd /home/USER

I get

sudo: cd: command not found

What is the correct syntax for the command to pass to sudo?