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
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.it should work.
You should make sure that the path which contains the sym link is in PATH enviroment variable
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:
then save and exit and run