This question already has an answer here:
- changing current working dir with a script 2 answers
- su vs sudo -s vs sudo bash 2 answers
I have a folder with chmod 000
permissions on it with a lot of different stuff in, the way I get in is a start bash
in sudo
by running sudo bash
.
Why can't I do &&
? I want to cd
into the directory with one command like this:
sudo bash && cd desktop
When I run this, I am still in ~
which is the default directory.
I have to run this instead
sudo bash
cd desktop
Also, the desktop is not the folder, its a subfolder of desktop, but it doesn't matter. It's the same thing anyways.