Find the answer to your Linux question:
Results 1 to 6 of 6
When you build an app in Windows, the "proper" location for it is: C:\Program Files\Company\AppName Or some variation of the above. What is the "proper" or "recommended" location to build ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    59

    The "Correct" location for an app in linux

    When you build an app in Windows, the "proper" location for it is:

    C:\Program Files\Company\AppName

    Or some variation of the above.

    What is the "proper" or "recommended" location to build custom apps in linux? I'm running debian if that matters

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    The Linux filesystem roughly adheres to the Filesystem Hierarchy Standard:
    Filesystem Hierarchy Standard

    According to the standard, independently-installed software should generally be placed in the appropriate /usr/local subdirectories (/usr/local/bin for the executables, /usr/local/include for new library headers, etc.).

    /opt used to be popular for packages (e.g. /opt/mypackage/bin, etc.), but this has generally fallen out of favour. In particular, using /opt means that standard utilities generally won't work, as each subdirectory of /opt can be organized in any fashion, as opposed to the standardized format of /usr and /usr/local.
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    195

    Your package Manager takes care of that stuff.

    If you build it from soure it is different.

    I had a simular post that is here http://www.linuxforums.org/forum/pro...best-done.html


  4. #4
    Just Joined!
    Join Date
    Jan 2011
    Posts
    59
    Quote Originally Posted by Cabhan View Post
    The Linux filesystem roughly adheres to the Filesystem Hierarchy Standard:
    Filesystem Hierarchy Standard

    According to the standard, independently-installed software should generally be placed in the appropriate /usr/local subdirectories (/usr/local/bin for the executables, /usr/local/include for new library headers, etc.).

    /opt used to be popular for packages (e.g. /opt/mypackage/bin, etc.), but this has generally fallen out of favour. In particular, using /opt means that standard utilities generally won't work, as each subdirectory of /opt can be organized in any fashion, as opposed to the standardized format of /usr and /usr/local.
    Thanks for the reply!

    So based on description from above site, /usr/local/mycompany/myapp would be a good location?

  5. #5
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Quote Originally Posted by phpguy View Post
    Thanks for the reply!

    So based on description from above site, /usr/local/mycompany/myapp would be a good location?
    Nope. The format you are using would be more appropriate to /opt, but we don't generally recommend that.

    Let's suppose that the name of the application is "my_app". In that case, you might create the following:

    /usr/local/bin/my_app
    /usr/local/share/doc/my_app/user_manual.pdf
    /usr/local/share/pixmaps/my_app.png

    This is the standard, and is generally expected. You can, of course, use whatever format you would like. I have seen software that takes a very different approach, but it is generally confusing to use.
    DISTRO=Arch
    Registered Linux User #388732

  6. #6
    Linux Newbie Nagarjuna's Avatar
    Join Date
    Feb 2011
    Posts
    122
    One thing to keep in mind if you use the shell a lot, is that unless the directory with your binaries is added to the $PATH variable, you'll need to execute the application by it's full directory path (/usr/bin/local/company/myapp) instead of just the name of the binary (myapp).

    Usually the most popular locations are already added to the $PATH variable, but you can easily add a location to it.

    To see what is already in your $PATH:

    Code:
    echo $PATH
    To add a directory to your $PATH:

    Code:
    PATH=$PATH:/usr/bin/local/company/myapp
    export PATH
    If you'd like to make the change permanent, you can add it to your .bash_profile script in your home directory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...