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.

3
  • 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. Commented Jul 19, 2020 at 12:19
  • Something's gone wrong with your .bashrc or .bash_profile files. Edit these files and fix any problems. Commented Jul 19, 2020 at 13:21
  • I edited my /etc/environment file. It seems to work perfectly. Robert can you please write a solution to accept? Thanks Commented Jul 19, 2020 at 14:12

1 Answer 1

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.

1
  • Yes, but editing /etc/environment just masks the problem. It's going to still be lurking out there somewhere. Commented Jul 19, 2020 at 18:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.