if I am creating softlink in /usr/bin it is working , but if trying to make in /home/User directory , link is not working what can be done? [closed]

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.

  • 1

    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 as hello will search the directories specified by the PATH environment variable. It is possible to add . to the list of directories in PATH but that is not recommended for security reasons.

    – 

Leave a Comment