"Command not found" for all commands in Kali

2

I'm running Kali Linux 64 bit on my computer. I keep getting the message '-bash: command not found'; doesn't matter what command I type (e.g., ifconfig or airmon-ng). Is there a way of fixing this problem?

Erik Viljoen

Posted 2016-08-27T19:57:55.117

Reputation: 21

2It sounds like you have destroyed your path. Can you execute an editor? /bin/vi? – DavidPostill – 2016-08-27T20:30:05.207

Answers

0

Like the commenter said: Something is wrong with your Environment, possibly the PATH. Many things can cause this, but here are a few to check:

echo $PATH If it's empty, it needs to be filled, in addition to finding out why it's empty.

I remember first getting this around 15 years ago when I was first starting to learn unix-like OSes: I managed to learn the hard way the dangers of rm -rf, and I deleted my home directory. (FreeBSD 3.3, if my memory serves me right)

Jarmund

Posted 2016-08-27T19:57:55.117

Reputation: 5 155

thanks for your reply. yes the space is empty. what should i do to fix this problem? thanks – Erik Viljoen – 2016-08-30T19:03:17.653

do you know how to fix this ( command not found ) problem. if so could you please give me steps to fix this problem thanks. – Erik Viljoen – 2016-08-30T19:05:10.073

allso, if I boot kali linux on a new computer would this problem still exist. and what is the easiest wat to solve the problem. – Erik Viljoen – 2016-08-30T19:08:29.710

2Write export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" and you will have it in your current session. Is your /etc/environment empty? Does ls ~ give any output? – Mikael Kjær – 2018-05-31T06:48:56.707