Command Not Found Errors

To execute a UNIX command, utility, or shell script, simply type the command name at the shell prompt, including any options and arguments needed by the command. Some commands are built into the shell program, but most standard UNIX commands are program files stored in directories such as /bin, /usr/bin/, /etc/, /usr/local/bin, /sbin, and so on.

If you try to run a command, you might get an error like this:

$ myscript
myscript: not found
$ ./myscript

It’s common to see this not found error when you first begin writing your own shell scripts. If the script is in your current directory, run the file as ./scriptname. This might solve the problem.

If you still get a command not found error, check that you have ...

Get Practical UNIX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.