How to make symlink executable?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















I am using the Cloud9.io IDE.



I have downloaded the Julia generic executable and extracted it.



sudo wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz
tar xvzf julia-1.0.3-linux-x86_64.tar.gz


now I can run the program by julia-1.0.3/bin/julia.



So the next step I try to make a symlink so I just run the program by entering julia. So I tried



sudo ln -s julia-1.0.3/bin/julia julia



and when I run julia it says




bash: julia: command not found




But the file is clearly in my directory. What am I missing here?










share|improve this question




























    1















    I am using the Cloud9.io IDE.



    I have downloaded the Julia generic executable and extracted it.



    sudo wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz
    tar xvzf julia-1.0.3-linux-x86_64.tar.gz


    now I can run the program by julia-1.0.3/bin/julia.



    So the next step I try to make a symlink so I just run the program by entering julia. So I tried



    sudo ln -s julia-1.0.3/bin/julia julia



    and when I run julia it says




    bash: julia: command not found




    But the file is clearly in my directory. What am I missing here?










    share|improve this question


























      1












      1








      1








      I am using the Cloud9.io IDE.



      I have downloaded the Julia generic executable and extracted it.



      sudo wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz
      tar xvzf julia-1.0.3-linux-x86_64.tar.gz


      now I can run the program by julia-1.0.3/bin/julia.



      So the next step I try to make a symlink so I just run the program by entering julia. So I tried



      sudo ln -s julia-1.0.3/bin/julia julia



      and when I run julia it says




      bash: julia: command not found




      But the file is clearly in my directory. What am I missing here?










      share|improve this question
















      I am using the Cloud9.io IDE.



      I have downloaded the Julia generic executable and extracted it.



      sudo wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz
      tar xvzf julia-1.0.3-linux-x86_64.tar.gz


      now I can run the program by julia-1.0.3/bin/julia.



      So the next step I try to make a symlink so I just run the program by entering julia. So I tried



      sudo ln -s julia-1.0.3/bin/julia julia



      and when I run julia it says




      bash: julia: command not found




      But the file is clearly in my directory. What am I missing here?







      symlink






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 17 at 4:06







      xiaodai

















      asked Jan 15 at 22:52









      xiaodaixiaodai

      1084




      1084




















          2 Answers
          2






          active

          oldest

          votes


















          4














          Bash will find an executable specified by its bare filename (i.e. without preceding path elements) only if it is on its search path, which is stored in the PATH variable. The current directory is not necessarily on the search path.



          To see the current search path, try this:



          echo $PATH


          To see if a command is on your search path, try this:



          which command


          If command is on the search path, the which command will return the command's location on the file system. - To extend your search path with the directory of your command, try:



          PATH=$PATH:directory_to_be_added


          Note that directory_to_be_added should be the full directory name to the executable (not a directory relative to your current directory).



          Once the directory of your julia command has been added to your PATH, which julia should return julia's full pathname, and julia should be executable from anywhere on your filesystem.



          Changing the PATH is a general way of ensuring that executables that you use regularly are found by the shell. If you merely wish to run a command that is not on the search path once (i.e. in a one-off attempt), or you wish to override the search path, you can specify your command including pathname elements. So, to run a command that is in the current directory and not on the search path (or not the first command with that name on the search path), you could use ./command.






          share|improve this answer

























          • How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

            – xiaodai
            Jan 15 at 23:09






          • 3





            @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

            – ozzy
            Jan 15 at 23:17







          • 2





            I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

            – mattdm
            Jan 16 at 0:29






          • 1





            @mattdm You are right. I amended the answer accordingly.

            – ozzy
            Jan 16 at 8:11


















          2














          Answering to the question asked in the title.



          Nothing is required to make a symlink executable (or not executable for that matter).



          Actually, a symlink permissions serve no purpose on most OSes, including Linux. The execution permissions that are taken into account are the ones of the file linked to, if any.






          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494695%2fhow-to-make-symlink-executable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            Bash will find an executable specified by its bare filename (i.e. without preceding path elements) only if it is on its search path, which is stored in the PATH variable. The current directory is not necessarily on the search path.



            To see the current search path, try this:



            echo $PATH


            To see if a command is on your search path, try this:



            which command


            If command is on the search path, the which command will return the command's location on the file system. - To extend your search path with the directory of your command, try:



            PATH=$PATH:directory_to_be_added


            Note that directory_to_be_added should be the full directory name to the executable (not a directory relative to your current directory).



            Once the directory of your julia command has been added to your PATH, which julia should return julia's full pathname, and julia should be executable from anywhere on your filesystem.



            Changing the PATH is a general way of ensuring that executables that you use regularly are found by the shell. If you merely wish to run a command that is not on the search path once (i.e. in a one-off attempt), or you wish to override the search path, you can specify your command including pathname elements. So, to run a command that is in the current directory and not on the search path (or not the first command with that name on the search path), you could use ./command.






            share|improve this answer

























            • How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

              – xiaodai
              Jan 15 at 23:09






            • 3





              @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

              – ozzy
              Jan 15 at 23:17







            • 2





              I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

              – mattdm
              Jan 16 at 0:29






            • 1





              @mattdm You are right. I amended the answer accordingly.

              – ozzy
              Jan 16 at 8:11















            4














            Bash will find an executable specified by its bare filename (i.e. without preceding path elements) only if it is on its search path, which is stored in the PATH variable. The current directory is not necessarily on the search path.



            To see the current search path, try this:



            echo $PATH


            To see if a command is on your search path, try this:



            which command


            If command is on the search path, the which command will return the command's location on the file system. - To extend your search path with the directory of your command, try:



            PATH=$PATH:directory_to_be_added


            Note that directory_to_be_added should be the full directory name to the executable (not a directory relative to your current directory).



            Once the directory of your julia command has been added to your PATH, which julia should return julia's full pathname, and julia should be executable from anywhere on your filesystem.



            Changing the PATH is a general way of ensuring that executables that you use regularly are found by the shell. If you merely wish to run a command that is not on the search path once (i.e. in a one-off attempt), or you wish to override the search path, you can specify your command including pathname elements. So, to run a command that is in the current directory and not on the search path (or not the first command with that name on the search path), you could use ./command.






            share|improve this answer

























            • How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

              – xiaodai
              Jan 15 at 23:09






            • 3





              @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

              – ozzy
              Jan 15 at 23:17







            • 2





              I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

              – mattdm
              Jan 16 at 0:29






            • 1





              @mattdm You are right. I amended the answer accordingly.

              – ozzy
              Jan 16 at 8:11













            4












            4








            4







            Bash will find an executable specified by its bare filename (i.e. without preceding path elements) only if it is on its search path, which is stored in the PATH variable. The current directory is not necessarily on the search path.



            To see the current search path, try this:



            echo $PATH


            To see if a command is on your search path, try this:



            which command


            If command is on the search path, the which command will return the command's location on the file system. - To extend your search path with the directory of your command, try:



            PATH=$PATH:directory_to_be_added


            Note that directory_to_be_added should be the full directory name to the executable (not a directory relative to your current directory).



            Once the directory of your julia command has been added to your PATH, which julia should return julia's full pathname, and julia should be executable from anywhere on your filesystem.



            Changing the PATH is a general way of ensuring that executables that you use regularly are found by the shell. If you merely wish to run a command that is not on the search path once (i.e. in a one-off attempt), or you wish to override the search path, you can specify your command including pathname elements. So, to run a command that is in the current directory and not on the search path (or not the first command with that name on the search path), you could use ./command.






            share|improve this answer















            Bash will find an executable specified by its bare filename (i.e. without preceding path elements) only if it is on its search path, which is stored in the PATH variable. The current directory is not necessarily on the search path.



            To see the current search path, try this:



            echo $PATH


            To see if a command is on your search path, try this:



            which command


            If command is on the search path, the which command will return the command's location on the file system. - To extend your search path with the directory of your command, try:



            PATH=$PATH:directory_to_be_added


            Note that directory_to_be_added should be the full directory name to the executable (not a directory relative to your current directory).



            Once the directory of your julia command has been added to your PATH, which julia should return julia's full pathname, and julia should be executable from anywhere on your filesystem.



            Changing the PATH is a general way of ensuring that executables that you use regularly are found by the shell. If you merely wish to run a command that is not on the search path once (i.e. in a one-off attempt), or you wish to override the search path, you can specify your command including pathname elements. So, to run a command that is in the current directory and not on the search path (or not the first command with that name on the search path), you could use ./command.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 16 at 8:09

























            answered Jan 15 at 22:58









            ozzyozzy

            71715




            71715












            • How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

              – xiaodai
              Jan 15 at 23:09






            • 3





              @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

              – ozzy
              Jan 15 at 23:17







            • 2





              I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

              – mattdm
              Jan 16 at 0:29






            • 1





              @mattdm You are right. I amended the answer accordingly.

              – ozzy
              Jan 16 at 8:11

















            • How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

              – xiaodai
              Jan 15 at 23:09






            • 3





              @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

              – ozzy
              Jan 15 at 23:17







            • 2





              I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

              – mattdm
              Jan 16 at 0:29






            • 1





              @mattdm You are right. I amended the answer accordingly.

              – ozzy
              Jan 16 at 8:11
















            How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

            – xiaodai
            Jan 15 at 23:09





            How come julia-1.0.3/bin/julia works? So bash can run a executable if you specify the full path?

            – xiaodai
            Jan 15 at 23:09




            3




            3





            @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

            – ozzy
            Jan 15 at 23:17






            @xiaodai The PATH is consulted only in case the command that your trying to execute has no path-elements in it. So you could run julia from the current directory by giving the command ./julia (the ./ being the path element that prevents a PATH search). Similarly, your command julia-1.0.3/bin/julia includes path elements, which causes Bash not to search the PATH, but instead to run the specified executable directly.

            – ozzy
            Jan 15 at 23:17





            2




            2





            I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

            – mattdm
            Jan 16 at 0:29





            I'd recommend putting the part about ./julia in your answer — that's the normal thing people do.

            – mattdm
            Jan 16 at 0:29




            1




            1





            @mattdm You are right. I amended the answer accordingly.

            – ozzy
            Jan 16 at 8:11





            @mattdm You are right. I amended the answer accordingly.

            – ozzy
            Jan 16 at 8:11













            2














            Answering to the question asked in the title.



            Nothing is required to make a symlink executable (or not executable for that matter).



            Actually, a symlink permissions serve no purpose on most OSes, including Linux. The execution permissions that are taken into account are the ones of the file linked to, if any.






            share|improve this answer



























              2














              Answering to the question asked in the title.



              Nothing is required to make a symlink executable (or not executable for that matter).



              Actually, a symlink permissions serve no purpose on most OSes, including Linux. The execution permissions that are taken into account are the ones of the file linked to, if any.






              share|improve this answer

























                2












                2








                2







                Answering to the question asked in the title.



                Nothing is required to make a symlink executable (or not executable for that matter).



                Actually, a symlink permissions serve no purpose on most OSes, including Linux. The execution permissions that are taken into account are the ones of the file linked to, if any.






                share|improve this answer













                Answering to the question asked in the title.



                Nothing is required to make a symlink executable (or not executable for that matter).



                Actually, a symlink permissions serve no purpose on most OSes, including Linux. The execution permissions that are taken into account are the ones of the file linked to, if any.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 16 at 0:07









                jlliagrejlliagre

                46.9k783133




                46.9k783133



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494695%2fhow-to-make-symlink-executable%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?