Why have symbolic links between files in folders at same depth?Deleting home folders ~symbolic links in Mac OS X “brew link node” creates/removes different number of symlinks when repeatedHow to make Smart folder like physical folder with the combined contents of two foldersapp to manage symbolic links and move files automatically?Automator can't find Symbolic Links?Emacs does not auto restart after reboot?grepping /Library and “Too many levels of symbolic links”Bash script for creating symbolic linkssymbolic link vs. aliasWhich filesystems support symbolic links?

Comparison of bool data types in C++

Why is unzipped directory exactly 4.0K (much smaller than zipped file)?

The disk image is 497GB smaller than the target device

Alexandrov's generalization of Cauchy's rigidity theorem

If I arrive in the UK, and then head to mainland Europe, does my Schengen visa 90 day limit start when I arrived in the UK, or mainland Europe?

Physical only checkdb is failing, but full one is completed successfully

Is it normal to "extract a paper" from a master thesis?

Prince of Darkness goes cryptic

What is to the west of Westeros?

Complications of displaced core material?

Keeping the dodos out of the field

EU rights when flight delayed so much that return is missed

How can I get a refund from a seller who only accepts Zelle?

Who wrote “A writer only begins a book. A reader finishes it.”

Are runways booked by airlines to land their planes?

Are there historical examples of audiences drawn to a work that was "so bad it's good"?

Split into three!

(For training purposes) Are there any openings with rook pawns that are more effective than others (and if so, what are they)?

How did the Allies achieve air superiority on Sicily?

Why is 'additive' EQ more difficult to use than 'subtractive'?

Seeking closure over someone I have unblocked but whom I learned have passed on

Why A=2 and B=1 in the call signs for Spirit and Opportunity?

How to create a `range`-like iterable object of floats?

Can a UK national work as a paid shop assistant in the USA?



Why have symbolic links between files in folders at same depth?


Deleting home folders ~symbolic links in Mac OS X “brew link node” creates/removes different number of symlinks when repeatedHow to make Smart folder like physical folder with the combined contents of two foldersapp to manage symbolic links and move files automatically?Automator can't find Symbolic Links?Emacs does not auto restart after reboot?grepping /Library and “Too many levels of symbolic links”Bash script for creating symbolic linkssymbolic link vs. aliasWhich filesystems support symbolic links?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I noticed that in macOS, the /usr/local/Cellar folder contains binaries installed using Homebrew, and that /usr/local/opt has symbolic links to a bunch of those binaries. I haven't used symbolic links much, but as I understand it, the purpose of them is to create a link in a convenient location to a file/folder that acts as a copy of that file/folder, without having to move that file/folder from its original location.



So my questions are:



  1. Am I correct in my understanding of symbolic links there?


  2. If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure? Under what circumstances would you use these symbolic links where you couldn't just use the binaries?










share|improve this question









New contributor



gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    3















    I noticed that in macOS, the /usr/local/Cellar folder contains binaries installed using Homebrew, and that /usr/local/opt has symbolic links to a bunch of those binaries. I haven't used symbolic links much, but as I understand it, the purpose of them is to create a link in a convenient location to a file/folder that acts as a copy of that file/folder, without having to move that file/folder from its original location.



    So my questions are:



    1. Am I correct in my understanding of symbolic links there?


    2. If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure? Under what circumstances would you use these symbolic links where you couldn't just use the binaries?










    share|improve this question









    New contributor



    gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      3












      3








      3








      I noticed that in macOS, the /usr/local/Cellar folder contains binaries installed using Homebrew, and that /usr/local/opt has symbolic links to a bunch of those binaries. I haven't used symbolic links much, but as I understand it, the purpose of them is to create a link in a convenient location to a file/folder that acts as a copy of that file/folder, without having to move that file/folder from its original location.



      So my questions are:



      1. Am I correct in my understanding of symbolic links there?


      2. If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure? Under what circumstances would you use these symbolic links where you couldn't just use the binaries?










      share|improve this question









      New contributor



      gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I noticed that in macOS, the /usr/local/Cellar folder contains binaries installed using Homebrew, and that /usr/local/opt has symbolic links to a bunch of those binaries. I haven't used symbolic links much, but as I understand it, the purpose of them is to create a link in a convenient location to a file/folder that acts as a copy of that file/folder, without having to move that file/folder from its original location.



      So my questions are:



      1. Am I correct in my understanding of symbolic links there?


      2. If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure? Under what circumstances would you use these symbolic links where you couldn't just use the binaries?







      mojave filesystem symlink






      share|improve this question









      New contributor



      gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 3 hours ago









      Nimesh Neema

      19.2k75084




      19.2k75084






      New contributor



      gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 5 hours ago









      gkeenleygkeenley

      1161




      1161




      New contributor



      gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      gkeenley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          3 Answers
          3






          active

          oldest

          votes


















          1















          Am I correct in my understanding of symbolic links there?




          Yes. Symbolic link, as the name implies acts as a link to a file/folder located elsewhere. Accessing the link is generally equivalent to accessing the file/folder.




          If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure?




          If you'll carefully observer in this particular case, the binaries corresponding to all the various installed formulae are in different folders. There's a separate folder corresponding to each installed formula under /usr/local/Cellar. Within the folder for formula is a folder containing version number, followed by installed files for the formula.



          Via symlink under /usr/local/opt, the installation location for all the formula are brought in one place.



          For knowing the exact purpose of why /usr/local/opt folder is created by Homebrew, you can refer to this post on Stack Overflow:



          • https://stackoverflow.com/questions/35337601/why-is-there-a-usr-local-opt-directory-created-by-homebrew-and-should-i-use-it





          share|improve this answer






























            1














            I’m not that familiar with Homebrew, but the pattern you are describing is one I’ve seen other software installers use: it makes various binaries available under one directory, while making it easy to tell what software package they come from. The screenshot below is from an article about Homebrew, and shows a listing of the directory “/usr/local/opt”, with the various symbolic links pointing to subdirectories of “/usr/local/Cellar”. While most of the binaries point to a package with the same name, this is for example not the case for “npm”, where the symbolic link makes it easy to tell that it is part of the same package as “node” and “nodejs”. Symbolic links are used here for filesystem organization purposes: all of the files of a package are kept together in one place, while making them available from other directories as needed.



            enter image description here



            You may also be interested in an example of how symbolic links are sometimes used without even pointing to a different directory at all. Take a look at the output of ls -l /usr/bin | grep vim, which should show various links pointing to “vim” in the same directory, for example “ex” and “view”. As the man page for “vim” explains:



             Vim behaves differently, depending on the name of the command (the exe-
            cutable may still be the same file).

            vim The "normal" way, everything is default.

            ex Start in Ex mode. Go to Normal mode with the ":vi" command.
            Can also be done with the "-e" argument.

            view Start in read-only mode. You will be protected from writing
            the files. Can also be done with the "-R" argument.





            share|improve this answer
































              0














              The most common reason is "canonical-ize" the original file/binary. This could mean placing binaries in a canonical location — in this case, symlinks are placed in /usr/local/opt because your computer expects to find binaries there but not necessarily in /usr/local/Cellar (likely based on your shell $PATH variable). It could also be used to designate a single binary in a group of related binaries as "official" while keeping the other related binaries around but not immediately available — for instance, you might have installed many packages, each relying on a different version of Python, while you have specifically installed the latest version of Python for yourself. In this case, you might have binaries python34, python35, python36 etc in your Cellar folder, and a python binary in /usr/local/opt that links to the Python binary you requested be installed, python36.






              share|improve this answer






























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1















                Am I correct in my understanding of symbolic links there?




                Yes. Symbolic link, as the name implies acts as a link to a file/folder located elsewhere. Accessing the link is generally equivalent to accessing the file/folder.




                If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure?




                If you'll carefully observer in this particular case, the binaries corresponding to all the various installed formulae are in different folders. There's a separate folder corresponding to each installed formula under /usr/local/Cellar. Within the folder for formula is a folder containing version number, followed by installed files for the formula.



                Via symlink under /usr/local/opt, the installation location for all the formula are brought in one place.



                For knowing the exact purpose of why /usr/local/opt folder is created by Homebrew, you can refer to this post on Stack Overflow:



                • https://stackoverflow.com/questions/35337601/why-is-there-a-usr-local-opt-directory-created-by-homebrew-and-should-i-use-it





                share|improve this answer



























                  1















                  Am I correct in my understanding of symbolic links there?




                  Yes. Symbolic link, as the name implies acts as a link to a file/folder located elsewhere. Accessing the link is generally equivalent to accessing the file/folder.




                  If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure?




                  If you'll carefully observer in this particular case, the binaries corresponding to all the various installed formulae are in different folders. There's a separate folder corresponding to each installed formula under /usr/local/Cellar. Within the folder for formula is a folder containing version number, followed by installed files for the formula.



                  Via symlink under /usr/local/opt, the installation location for all the formula are brought in one place.



                  For knowing the exact purpose of why /usr/local/opt folder is created by Homebrew, you can refer to this post on Stack Overflow:



                  • https://stackoverflow.com/questions/35337601/why-is-there-a-usr-local-opt-directory-created-by-homebrew-and-should-i-use-it





                  share|improve this answer

























                    1












                    1








                    1








                    Am I correct in my understanding of symbolic links there?




                    Yes. Symbolic link, as the name implies acts as a link to a file/folder located elsewhere. Accessing the link is generally equivalent to accessing the file/folder.




                    If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure?




                    If you'll carefully observer in this particular case, the binaries corresponding to all the various installed formulae are in different folders. There's a separate folder corresponding to each installed formula under /usr/local/Cellar. Within the folder for formula is a folder containing version number, followed by installed files for the formula.



                    Via symlink under /usr/local/opt, the installation location for all the formula are brought in one place.



                    For knowing the exact purpose of why /usr/local/opt folder is created by Homebrew, you can refer to this post on Stack Overflow:



                    • https://stackoverflow.com/questions/35337601/why-is-there-a-usr-local-opt-directory-created-by-homebrew-and-should-i-use-it





                    share|improve this answer














                    Am I correct in my understanding of symbolic links there?




                    Yes. Symbolic link, as the name implies acts as a link to a file/folder located elsewhere. Accessing the link is generally equivalent to accessing the file/folder.




                    If so, why would you create symbolic links in one folder (/usr/local/opt) to binaries in another folder (/usr/local/Cellar) that is at a similar location/depth in the file structure?




                    If you'll carefully observer in this particular case, the binaries corresponding to all the various installed formulae are in different folders. There's a separate folder corresponding to each installed formula under /usr/local/Cellar. Within the folder for formula is a folder containing version number, followed by installed files for the formula.



                    Via symlink under /usr/local/opt, the installation location for all the formula are brought in one place.



                    For knowing the exact purpose of why /usr/local/opt folder is created by Homebrew, you can refer to this post on Stack Overflow:



                    • https://stackoverflow.com/questions/35337601/why-is-there-a-usr-local-opt-directory-created-by-homebrew-and-should-i-use-it






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 3 hours ago









                    Nimesh NeemaNimesh Neema

                    19.2k75084




                    19.2k75084























                        1














                        I’m not that familiar with Homebrew, but the pattern you are describing is one I’ve seen other software installers use: it makes various binaries available under one directory, while making it easy to tell what software package they come from. The screenshot below is from an article about Homebrew, and shows a listing of the directory “/usr/local/opt”, with the various symbolic links pointing to subdirectories of “/usr/local/Cellar”. While most of the binaries point to a package with the same name, this is for example not the case for “npm”, where the symbolic link makes it easy to tell that it is part of the same package as “node” and “nodejs”. Symbolic links are used here for filesystem organization purposes: all of the files of a package are kept together in one place, while making them available from other directories as needed.



                        enter image description here



                        You may also be interested in an example of how symbolic links are sometimes used without even pointing to a different directory at all. Take a look at the output of ls -l /usr/bin | grep vim, which should show various links pointing to “vim” in the same directory, for example “ex” and “view”. As the man page for “vim” explains:



                         Vim behaves differently, depending on the name of the command (the exe-
                        cutable may still be the same file).

                        vim The "normal" way, everything is default.

                        ex Start in Ex mode. Go to Normal mode with the ":vi" command.
                        Can also be done with the "-e" argument.

                        view Start in read-only mode. You will be protected from writing
                        the files. Can also be done with the "-R" argument.





                        share|improve this answer





























                          1














                          I’m not that familiar with Homebrew, but the pattern you are describing is one I’ve seen other software installers use: it makes various binaries available under one directory, while making it easy to tell what software package they come from. The screenshot below is from an article about Homebrew, and shows a listing of the directory “/usr/local/opt”, with the various symbolic links pointing to subdirectories of “/usr/local/Cellar”. While most of the binaries point to a package with the same name, this is for example not the case for “npm”, where the symbolic link makes it easy to tell that it is part of the same package as “node” and “nodejs”. Symbolic links are used here for filesystem organization purposes: all of the files of a package are kept together in one place, while making them available from other directories as needed.



                          enter image description here



                          You may also be interested in an example of how symbolic links are sometimes used without even pointing to a different directory at all. Take a look at the output of ls -l /usr/bin | grep vim, which should show various links pointing to “vim” in the same directory, for example “ex” and “view”. As the man page for “vim” explains:



                           Vim behaves differently, depending on the name of the command (the exe-
                          cutable may still be the same file).

                          vim The "normal" way, everything is default.

                          ex Start in Ex mode. Go to Normal mode with the ":vi" command.
                          Can also be done with the "-e" argument.

                          view Start in read-only mode. You will be protected from writing
                          the files. Can also be done with the "-R" argument.





                          share|improve this answer



























                            1












                            1








                            1







                            I’m not that familiar with Homebrew, but the pattern you are describing is one I’ve seen other software installers use: it makes various binaries available under one directory, while making it easy to tell what software package they come from. The screenshot below is from an article about Homebrew, and shows a listing of the directory “/usr/local/opt”, with the various symbolic links pointing to subdirectories of “/usr/local/Cellar”. While most of the binaries point to a package with the same name, this is for example not the case for “npm”, where the symbolic link makes it easy to tell that it is part of the same package as “node” and “nodejs”. Symbolic links are used here for filesystem organization purposes: all of the files of a package are kept together in one place, while making them available from other directories as needed.



                            enter image description here



                            You may also be interested in an example of how symbolic links are sometimes used without even pointing to a different directory at all. Take a look at the output of ls -l /usr/bin | grep vim, which should show various links pointing to “vim” in the same directory, for example “ex” and “view”. As the man page for “vim” explains:



                             Vim behaves differently, depending on the name of the command (the exe-
                            cutable may still be the same file).

                            vim The "normal" way, everything is default.

                            ex Start in Ex mode. Go to Normal mode with the ":vi" command.
                            Can also be done with the "-e" argument.

                            view Start in read-only mode. You will be protected from writing
                            the files. Can also be done with the "-R" argument.





                            share|improve this answer















                            I’m not that familiar with Homebrew, but the pattern you are describing is one I’ve seen other software installers use: it makes various binaries available under one directory, while making it easy to tell what software package they come from. The screenshot below is from an article about Homebrew, and shows a listing of the directory “/usr/local/opt”, with the various symbolic links pointing to subdirectories of “/usr/local/Cellar”. While most of the binaries point to a package with the same name, this is for example not the case for “npm”, where the symbolic link makes it easy to tell that it is part of the same package as “node” and “nodejs”. Symbolic links are used here for filesystem organization purposes: all of the files of a package are kept together in one place, while making them available from other directories as needed.



                            enter image description here



                            You may also be interested in an example of how symbolic links are sometimes used without even pointing to a different directory at all. Take a look at the output of ls -l /usr/bin | grep vim, which should show various links pointing to “vim” in the same directory, for example “ex” and “view”. As the man page for “vim” explains:



                             Vim behaves differently, depending on the name of the command (the exe-
                            cutable may still be the same file).

                            vim The "normal" way, everything is default.

                            ex Start in Ex mode. Go to Normal mode with the ":vi" command.
                            Can also be done with the "-e" argument.

                            view Start in read-only mode. You will be protected from writing
                            the files. Can also be done with the "-R" argument.






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 1 hour ago

























                            answered 2 hours ago









                            RinzwindRinzwind

                            2,40642242




                            2,40642242





















                                0














                                The most common reason is "canonical-ize" the original file/binary. This could mean placing binaries in a canonical location — in this case, symlinks are placed in /usr/local/opt because your computer expects to find binaries there but not necessarily in /usr/local/Cellar (likely based on your shell $PATH variable). It could also be used to designate a single binary in a group of related binaries as "official" while keeping the other related binaries around but not immediately available — for instance, you might have installed many packages, each relying on a different version of Python, while you have specifically installed the latest version of Python for yourself. In this case, you might have binaries python34, python35, python36 etc in your Cellar folder, and a python binary in /usr/local/opt that links to the Python binary you requested be installed, python36.






                                share|improve this answer



























                                  0














                                  The most common reason is "canonical-ize" the original file/binary. This could mean placing binaries in a canonical location — in this case, symlinks are placed in /usr/local/opt because your computer expects to find binaries there but not necessarily in /usr/local/Cellar (likely based on your shell $PATH variable). It could also be used to designate a single binary in a group of related binaries as "official" while keeping the other related binaries around but not immediately available — for instance, you might have installed many packages, each relying on a different version of Python, while you have specifically installed the latest version of Python for yourself. In this case, you might have binaries python34, python35, python36 etc in your Cellar folder, and a python binary in /usr/local/opt that links to the Python binary you requested be installed, python36.






                                  share|improve this answer

























                                    0












                                    0








                                    0







                                    The most common reason is "canonical-ize" the original file/binary. This could mean placing binaries in a canonical location — in this case, symlinks are placed in /usr/local/opt because your computer expects to find binaries there but not necessarily in /usr/local/Cellar (likely based on your shell $PATH variable). It could also be used to designate a single binary in a group of related binaries as "official" while keeping the other related binaries around but not immediately available — for instance, you might have installed many packages, each relying on a different version of Python, while you have specifically installed the latest version of Python for yourself. In this case, you might have binaries python34, python35, python36 etc in your Cellar folder, and a python binary in /usr/local/opt that links to the Python binary you requested be installed, python36.






                                    share|improve this answer













                                    The most common reason is "canonical-ize" the original file/binary. This could mean placing binaries in a canonical location — in this case, symlinks are placed in /usr/local/opt because your computer expects to find binaries there but not necessarily in /usr/local/Cellar (likely based on your shell $PATH variable). It could also be used to designate a single binary in a group of related binaries as "official" while keeping the other related binaries around but not immediately available — for instance, you might have installed many packages, each relying on a different version of Python, while you have specifically installed the latest version of Python for yourself. In this case, you might have binaries python34, python35, python36 etc in your Cellar folder, and a python binary in /usr/local/opt that links to the Python binary you requested be installed, python36.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 1 hour ago









                                    BallpointBenBallpointBen

                                    23327




                                    23327













                                        Popular posts from this blog

                                        Siegen Nawigatsjuun

                                        Log på Navigationsmenu

                                        Log på Navigationsmenu