I have tried one scenario, where I created .c file of “hello world” program, compiled and created executable file. and tried to create the softlink of this file in /usr/bin directory using command “sudo ln -s ~/Desktop/nilima/hello /usr/bin/hello” and it was working.
Next time I removed soft link created above from /usr/bin using “sudo rm hello” & tried to make in user directory using command, “ln -s ~/Desktop/nilima/hello /home/nilima/hello”, but in this case softlink is not working.
According to me, link created in home directory(or any directory) should be working.
What do you mean that it is not working? Do you get any errors?
From the shell, you should be able to run
/home/nilima/hello
or~/hello
. If your shell’s current directory is your home directory, you should be able to run./hello
. Running a bare command such ashello
will search the directories specified by thePATH
environment variable. It is possible to add.
to the list of directories inPATH
but that is not recommended for security reasons.