SUDO: CD: Command not found

I was trying to delete a remnant folder from trying to mount my work harddrive using NTFS-3G, but the folder it left behind in /media/System caused me to not to be able to re-mount the harddrive later on.

So, I tried to delete it, but got the first error “Permission Denied”, then I tried with SUDO, but even just when trying to change to directory, I got the error “SUDO: CD: Command not found”.. Now how come SUDO can’t find CD, a basic bash command. Don’t ask me, but here it the workaround.

While in the Terminal, type “SUDO SH”, this opens a new shell at administrator level and now you can access highlevel protected folders and delete them using normal bash commands.

One Response to “SUDO: CD: Command not found”

  • Stephen D:

    ‘cd’ is built into your shell, which is why you can’t ‘sudo cd’ (man bash)

    the best way to get a proper root environment is to ‘sudo su -’ (this gives you a root shell with all the root PATH and other environment variables that aren’t available to a normal user)

Leave a Reply