I had the same problem and I found a solution.
There are many other variants of what I call the
"10 second" issue.
My situation was exactly chleba's. I could not ls or apt-get. So I pressed
<ctrl>+<alt>+<F1> and I got into tty1, and I logged in as root. However, I could still
echo $PATH, which gave me something that I changed (messed up) yesterday. Then I ran
(^ Sorry for crappy formatting. Source: wikihow.com/Change-the-Path-Variable-in-Linux)
Now, you can
cat, all that. BUT WAIT! Don't exit by pressing
<ctrl>+<alt>+<F7>! You need to change your
~/.profile files first to temporarily declare what directories you want your system to be able to access directly. If you're like me, you might not have a
~/.bashrc in your directory yet. Also, if you are logged in as root, aka you entered your 'username' or whatever as 'root', then you will have to
cd /home/[HomeDirName] to get there. If you logged in with your usual credentials, you can just
cd ~ and you'll be where we want to be. From here, run
nano .profile or
sudo nano .profile and at the very bottom add
export PATH=$PATH:... all the same stuff as above. Then run
[sudo] nano .bashrc, which creates the
.bashrc file if it does not already exist (which was the case for me), and just paste in the same ol'
export PATH=$PATH:... stuff.
Now you should be good.
Everyone likes extra goodies.
My bet is that you could still run
apt-get, etc. You would just have to navigate to
/etc/bin to run them, or run
./etc/bin/ls.sh or something. I don't really know where the coreutils are located, but it would look something like the above.
In Linux Mint 17, according to my dad and this, your
$PATH variable is located at
/etc/environment. So you could just change that, which might not be a temporary fix. If you have time to look into that, drop a comment on whether or not that is a temporary fix. Just create a shell script in your Downloads directory and paste
:~/[homeDirName]/Downloads at the end of the $PATH declaration in the environment file and see if you can run your shell script like this:
By the way, I got into this mess by trying to add shortcuts to scripts and applications scattered across my system.