0

Commands like ls, mv, nano, rm return a "command not found"

I think what might of caused the issue is that I've edited the .bash_profile on the server and ran a source ~/.bash_profile

ayame
  • 87
  • 8
  • Those are not bash commands. – Ignacio Vazquez-Abrams Oct 06 '15 at 02:17
  • What is the value of the PATH environment variable? – Michael Albers Oct 06 '15 at 02:18
  • when i use echo $PATH, i get /home/bitnami/.composer/vendor/bin – ayame Oct 06 '15 at 02:20
  • 1
    That's your problem. You're missing standard directories like /bin, /usr/bin, etc. If it helps, my PATH on Linux Mint is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games – Michael Albers Oct 06 '15 at 02:22
  • how would i change it back ? also, are you sure about that path... it says games in there. – ayame Oct 06 '15 at 02:25
  • Yes I am sure about that path. Typically the default path is set by the default .bashrc or similar file. Read the bash manpage to see what files are sourced in what order. Also check if you're setting PATH to "" anywhere. You'll probably want to remove that. – Michael Albers Oct 06 '15 at 02:28
  • Thank you Cyrus. That did the trick! Would you like to post the answer so I can select yours as the best? I've actually been searching for an answer for 3 hours. Might save some people quite a bit of time in the future – ayame Oct 06 '15 at 02:33

1 Answers1

1

Enter PATH="/usr/sbin:/usr/bin:/sbin:/bin" and then edit your .bash_profile

Cyrus
  • 84,225
  • 14
  • 89
  • 153