When you execute a program from the command line, you need to provide either an absolute pathname or a relative pathname to the executable file, unless the executable is located in a directory which is specified in your shell's
$PATH environment variable.
Absolute pathnames start relative to the root directory:
or this shorter version:
The second one works because
~cs50 is equivalent to
Using an absolute pathname like this should fix your problem. You will not even need to
cd to the CS50 Staff's home directory.
Relative pathnames start relative to the current working directory:
or like this:
or even like this:
When you type
server by itself on a line, instead of
./server (assuming that your working directory is
/home/cs50/pset6) the shell looks for the
server command in all the directories on your
In the IDE, the
$PATH is long and maybe a bit overwhelming:
~/workspace/ $ echo $PATH
In the Appliance, the
$PATH is shorter and easier to read:
jharvard@appliance (~): echo $PATH
Since there is no executable binary or script file named
server in any of those locations, the
bash shell responds with the helpful error message:
bash: server: command not found
The error message tells you three things. Most obviously, it tells you "command not found" -- something you typed was not found on the
Less obviously, it also tells you where the error is coming from ("bash:" -- the "Bourne Again SHell" command interpreter) and also what invalid command you tried to execute.
~/workspace/ $ waleed
bash: waleed: command not found
Hope this helps.