Q. Why I am getting the error Command not found? How do I fix this problem?
A. A common question asked by new Linux or UNIX users. When you get the error “Command not found” it means that Linux or UNIX searched for command everywhere it knew to look and could not find a program by that name. Another cause is you misspelled the command name (typo) or administrator does not at all install the command on your Linux/UNIX system. To get rid of this error:
1) Make sure command was not misspelled:
All Linux and UNIX commands are case sensitive and you type correct spelling of command.
2) Make sure command is your path
You can see current search path with following command:
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/home/vivekgite/bin
Usually all user commands are in /bin and /usr/bin or /usr/local/bin directories. All your programs are installed in these directories. When you type clear command, you are running /usr/bin/clear. So if it is not in path try to add directories to your search path as follows (setup Linux or UNIX search path with following bash export command):
$ export PATH=$PATH:/bin:/usr/local/bin
You can also find out of path of any command with which or whereis commands:
$ which ls
/bin/ls
$ which gcc
/usr/bin/gcc
$ which date
/bin/date
$ which cal
/usr/bin/cal
$ whereis gcc
/usr/bin/gcc
Remember you can run a program using its full pathname:
$ /bin/ls$ /bin/date
Finally, sometime you may not have permission to run the command

