When I list the contents of the bin folders on my system, I often only see the executable files. Some of the executables require additional files such as data and configuration files in order to run. Is there a standard system location where these files are stored in order for the executable to find them?
1 Answer
You don't mention your OS in this question, but I see in a previous question you are using macOS, which BSD-based. Since many applications are designed to operate the same on both Linux and BSD, however, the answer is generally the same.
In general, configuration and data could be stored almost anywhere, but that would be a bad idea, so by convention, there are some standards:
System-wide configuration files are stored in
/etcper the Filesystem Hierarchy Standard. Also see FHS differences between OS X, Linux and FreeBSD, but both Linux and BSD are in full agreement on/etc(and most of the rest of the FHS, as far as I know).User configuration has been a bit more undefined until relatively recently, with the XDG Base Directory Specification. Applications that follow that specification will store configuration in the directory specified by the
$XDG_CONFIG_HOMEvariable, or$HOME/.configotherwise.Again, that's relatively recently. I also recall from another question that you are using the Fish shell, which is one of the applications that follows this convention.
Additional data may be stored in several places, but the FHS defines "architecture-independent data" (such as Fish's built-in functions, for example) as being in
/usr/share.Then there's
/var, which holds "variable data files" such as log files, mail spools, etc.
I'm probably missing a few common candidates, and I purposely skipped libraries, which are code rather than "configuration and data." But do scan through the FHS and XDG Base Directory Specification for more info.
-
LOL! So UNIX has standards, but there's no enforcement. I just built svd2ada on MacOS and neither the build script nor the instructions advise on where and what files should be deployed to become part of the Ada toolchain. It's incredibly frustrating. MacOS outside UNIX has conventions that you dare not disobey, or you'll have users standing outside with pitchforks.ATL_DEV– ATL_DEV2022-02-25 00:45:37 +00:00Commented Feb 25, 2022 at 0:45
-
1@ATL_DEV From your comment here it sounds like you actually have an issue with a particular software package, and not with Unix as a whole. You may find that you will get much more specific help with this particular issue by asking more a more specific question.2022-02-25 09:07:52 +00:00Commented Feb 25, 2022 at 9:07
-
You answered my question. Thanks. The problem is that UNIX sucks major ass! It is incredibly user hostile. The user must go through needless pain and suffering because of half ass volunteer programming. It's been over 50 years and this shitty OS should have been history long ago! It's like driving in a buggy and carriage. If you use the horrible man documentation, press "q" to get out, wipes out the F$%#$ screen!ATL_DEV– ATL_DEV2022-02-25 20:51:23 +00:00Commented Feb 25, 2022 at 20:51
-
@ATL_DEV Note that the person that responded wasn't me. It kind of sounds like you are responding to them.NotTheDr01ds– NotTheDr01ds2022-02-25 20:56:57 +00:00Commented Feb 25, 2022 at 20:56
-
@NotTheDr01ds, oops. Stackoverflows needs some UI work. There's barely any contrast between the username text and the comment text. Adding a tiny avatar icon next to the username would also help make it stand out more.ATL_DEV– ATL_DEV2022-02-25 21:03:23 +00:00Commented Feb 25, 2022 at 21:03