type emacs
export TEMP=$PATH
export PATH=
type emacs
ls
type ls
type cd
export PATH=/usr/bin
type emacs #its been found
type ls #still not found
for FILE in /bin/* ; do echo "$FILE"; done
#emulate ls
export PATH=/bin/:$PATH
type ls #now we found it
export PATH=$TEMP #get our old path back
export PATH=${HOME}/usr/bin:$PATH
#for your own executables
#BUT it still might not help, you should always
#run programs in the current directory with the
# "./" notation
export $PATH=$PATH:.
mkdir temp
cd temp;ls
emacs -nw -q helloWorld.c
#C program:
#include <stdio.h>
int main() {
printf ("Hello, World.\n");
return 0;
}
C-x C-c ;to exit emacs
gcc helloWorld.c -otest
test #why doesn't my program do anything!?
echo $PATH #dot is in my path
type test
#oops, test is built in!, it'll get run first
./test
which test