Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux directories

I am writing installation script for my program, which is supposed to run on Linux/Unix OS. What is the default directory for the following files:

  1. Executable files (programs). Program should be executed by typing its name from the command line.
  2. Shared libraries.
  3. Third-party shared libraries (the program is not open source, so I need to redistribute third-party libraries).
  4. Read-only program configuration files for all users.
  5. Configuration data available for read/write access for all users.
like image 682
Alex F Avatar asked Mar 06 '26 23:03

Alex F


1 Answers

The listing varies depending on the Linux filesystem.

1) /bin, /usr/bin, /usr/local/bin

2/3) /lib, /usr/lib, /usr/local/lib

3. /usr/share/lib

4) /etc is a read-only spot for configuration data.

5) /usr/local/etc or usually in the /home directory under the dot directory name, if the profile allows the bin directory to be located under the /home/user_id/bin where 'user_id' is the relevant login id.. for an example for user 'jdoe', his configuration could be written to /home/jdoe/.configs or ~/.configs

Do not rely on this, for the most part the LSB filesystem dictates that there shall be at minimum: /bin, /etc, /usr, /lib, /home

For instance, the /usr could be on a different partition, likewise the same for /home

Edit: Thanks to dtrosset for pointing out my blooper....

like image 60
t0mm13b Avatar answered Mar 09 '26 14:03

t0mm13b



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!