Categories
Server

Command Not Found…All of a sudden a command is not Found!

Command Not Found: You’ve been having a good day up till now

When you type a common command in unix, it could be ls or last or who or grep or in my case rmate when low and behold, a response: bash: Command not Found

This is very annoying and is often the case where there are multiple root users on a server. There are 2 reasons for this problem:

1. Someone has removed the link to the directory to run the particular command usually found in:

/sbin
/bin
/usr/sbin
/usr/bin

2. Some has modified the path.

First of all check you path variable with:

echo $PATH

if this is the problem and you know where the link to the directory is use:

export PATH=$PATH:/path/to/dir1:/path/to/dir2

To append the new location or

export PATH=/path/to/dir1:/path/to/dir2

To set the new path.

An extremely annoying occurrence, especially when someone has done it undenounced to you and now you have to fix it.

If you are not on debian you may want to look at cyberciti linux tutorials.

echo $PATH