cd permission denied linux code example
Example 1: permission denied bash
chmod -R +x folder/*
# give execution permission for all scripts in the directory
Example 2: bash cd root permission denied
The best thing to do is sudo su or su, then cd to /root. You can (if you want) string together commands like this: su -c "cd /root; dostuff", but the first way is easier if you need to get into /root.