I use CentOS 7 and I install anaconda and some tools, after that some basic command like clear which not work.

[zhilevan@localhost ~]$ clear
bash: clear: command not found...

when I echo $PATH I see below results

[zhilevan@localhost ~]$ echo $PATH

Also, when I try to sudo yum install which but It says already installed.

Also I try export PATH=$PATH:/bin:/usr/local/bin but not correct.

where is the problem and how can I solve this problem?

  • Where is clear installed on your system? Does it exist in any other element of the $PATH? – choroba May 1 '16 at 6:41
  • @choroba tnx for your attention, it is not only clear, some commands not work. as example which.I echo $PATH and you can see what I have. – Yusef Mohamadi May 1 '16 at 6:44
  • But I don't see whether which or clear exist anywhere else in the $PATH. – choroba May 1 '16 at 6:49
  • @choroba where the clear , which and other command installed by defaults? /usr/bin ?? – Yusef Mohamadi May 1 '16 at 7:02
  • Try this: hash -r. See: help hash – Cyrus May 1 '16 at 8:03

It looks as though some of your commands have been modified/removed outside of yum.

You need to reinstall the missing commands like so:

yum reinstall which

You can give multiple packages as you identify them:

yum reinstall which clear

If you find that lots of commands have been removed, it may be easier to reinstall your whole system.

  • I try to fix all with yum reinstall *. thanks for your lead and attention. – Yusef Mohamadi May 1 '16 at 10:59

I would try to search for the missing command by its name.

find / -name which

Assuming 'which' is the missing command, then you can add it to you PATH.

  • sorry my problem is not about how can I find all this tcommand one by one,I think there is a mistake than cause all this issue starts. – Yusef Mohamadi May 1 '16 at 8:16
  • This is odd. It could be deleted by someone who has an access to your server. – Laith Al Obaidy May 17 '16 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.