1

I created a symbolic link via ln -s pathname/folder/file.py whatever and I now have a bright blue link in my home directory with the symbolic link command name but when I try whatever hello_world, it's giving me an error saying whatever: command not found.

What I want to do works when I re-type out the pathname and file but the symbolic link seems to be doing nothing....which means I did something wrong

  • Have you tried python whatever hello_world? – Terry Wang Sep 20 '13 at 2:05
4

That is likely nothing to do with symbolic links per se - it is probably because by default the shell does not search the current directory for executable files (regardless of whether they are regular files or symbolic links) - if you add the relative path to whatever i.e.

./whatever

it should work.

| improve this answer | |
1

You should make sure that the path which contains the sym link is in PATH enviroment variable

echo $PATH

or use ./whatever

to add the path to your $PATH edit .bashrc (It will specific for the current user if you want to be for all users edit /etc/profile) and add:

PATH=$PATH:pathname/folder/
export $PATH

then save and exit and run

source .bashrc
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.