2

When I login to my CentOS 7 Server I get a couple of errors.

Similar command is: 'tty'
bash: ls: command not found...
Similar command is: 'lz'
/usr/libexec/grepconf.sh: line 5: grep: command not found

Yesterday I tried to install the jre 9 by using this tutorial: https://howtoprogram.xyz/2017/09/22/install-oracle-java-9-centos-rhel/.

My server don't recognize commands like ls or yum. I tried to run yum reinstall grep but the response just was bash: yum: Befehl nicht gefunden... (command not found).

When I run echo $PATH the response is /usr/local/sbin:/usr/sbin:$PATH:$JAVA_HOME/bin:/root/.dotnet/tools:/root/bin.

Jonas Heinze
  • 43
  • 1
  • 9
  • It works for my session. Somehow does it not work in a new session. Do I have to save the PATH somehow? I'm using the ```export PATH=$PATH:/bin``` command. – Jonas Heinze Jul 19 '20 at 12:19
  • Something's gone wrong with your `.bashrc` or `.bash_profile` files. Edit these files and fix any problems. – Michael Hampton Jul 19 '20 at 13:21
  • I edited my ```/etc/environment``` file. It seems to work perfectly. Robert can you please write a solution to accept? Thanks – Jonas Heinze Jul 19 '20 at 14:12

1 Answers1

0

You need to put /bin on the path.

You can make that permanent by editing your shell's configuration file. If you're using bash that would be .bashrc or .bash_profile, if you're using a different shell the file will be different.

Note that editing /etc/environment to add /bin will likely fix things regardless of the shell. According to this answer /etc/environment normally points to /bin amongst other things.

Robert Longson
  • 325
  • 2
  • 11