Change directory using sudo
Solution 1:
Instead try using sudo -s
to start a root shell and then simply cd
into the directory.
When you're done as root, press CtrlD or type exit
.
It is important to note that as root, one can easily do damage to essential system components. Use with care!
Solution 2:
sudo sh -c "cd dir_path"