5

This is a more general and noob question. I am developing a small application in Linux (Ubuntu, to be more precise) and at this point I have an executable, a shared library (.so), a configuration file (.conf) with some settings to be read by the application at the beginning, a data folder with images and other resources to be used during the application life-time (resources that can be also modified, deleted) and of course, I would need some file for logs and messages (right now I am using syslog).

So, my question is, where should each one of these be stored when the application is installed on a client's computer? What is the standard way of organizing all the application's files in Linux? On Windows everything would be found usually in the C:\Program Files\(App Folder) but it looks like on Linux things are more (or less) organized. Can you give me some advices on this matter?

ali
  • 10,927
  • 20
  • 89
  • 138

2 Answers2

3

Program data were historically stored in dot-prefixed folders in user's home directory. Modern Linux distributions tends to use ~/.config/program_name folder.

For all files that will not be modified after distibution follow Linux standard:

Basilevs
  • 22,440
  • 15
  • 57
  • 102
  • So, that is where application specific data is stored (including big resource files, like those used by games ). – ali Jan 26 '14 at 16:59
  • I think so. (not exactly sure about very big files). Only modifiable data should go there obviously (for example images distributed with the program go to /usr/share) – Basilevs Jan 26 '14 at 17:00
  • 3
    ~/.config/program_name is for user specific data, common data goes to /usr/share, binaries to /usr/bin, shared libraries to /usr/lib etc. Logs normally go under /var/log, but probably it's enough to log to syslog, which is system log. – divanov Jan 26 '14 at 17:03
0

Ex: project dir: ABC sub directories:

logs - keep log files conf - keep configuration files here bin - executable binaries here traps - any trap mesg

then depend on what application we develop

Along with you can set level for starting your application from boot level if required.