Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Out of sheer curiosity, and perhaps boredom, I decided to play around with some linux distributions lately.
However, I quickly discovered something the confuses me greatly, that files for a program are spread out all across the filesystem, and that actual programs are needed to keep track of all the files for the purposes of installing and uninstalling. In windows, if something goes wrong, I just zoom over to the directory the program was in, delete it and am done, typically. The thought of something going wrong with the program managers for linux is horrendous.
Which explain what goes where, but I cannot find any explanation as to why things are laid out the way they are.
In windows, I become annoyed when the occasional program tries to use registry magic and shit all over my hard drive, but I am completely baffled at how linux seems to encourage it.
On windows I can simply brush off some of the sillier things as bad planning + the need to be backwards compatible, but in linux it seems to be very deliberate, so can someone please explain to me the reason for things being the way they are?
Am I overlooking something here? I'd like to tinker around with linux some more, but this is quite a stumbling block.
Actually, I had come across that, and did skim through that forward, but it only really addresses some of the more technical things (most of which are frankly above my head, or at least my casual need for understanding), rather than why things are laid out in that peculiar way.
All the files 7zip needs are all located within a single folder. If anything ever goes wrong with a new installation or uninstaller, I can simply find the folder, and delete it, and remove the reference. Done. I don't have to worry about naming conflicts, or files becoming orphaned. The only time there is a problem with anything, is when someone gets really "creative" with a program, and doesn't install the files in a easy to see common sense manner.
Correct me if I am wrong (which is entirely possible, I am very much a newbie here), but from what I can understand about linux, is that it wants me to take all those files, split them up, and put them in other folders with other files that have nothing to do with them.
Why?
As best I can tell, linux is quite deliberately making a mess of things.
Last edited by Nix Bood; 06-10-2009 at 07:37 PM.
Reason: spelling error
First of all, Linux ain't Windows (thank goodness). Don't try to understand Linux in the context of what you know about Windows.
Have you looked at the actual standard itself? It explains the purpose of the various hierarchies pretty well. Fundamentally, it boils down to two things. First, it is the *traditional* Unix layout. Second, the traditional Unix layout supports the basic security features found in Unix filesystems (but not Windows). Linux is quite deliberately making things secure.
You can take a look at Gobolinux for an alternative, more Windows-like, layout.
See, it seems elegant and simple to me; I know that if I want/need to change a config file, its going to be in a specific place. I know that programmes will be in a specific place dependant on their use. Its like a lower down version of (God I hate myself for such a simplistic analogy) the Windows Start Menu. Everything is in a specific place. Programmes you would see as an accessory are in accessories, whilst games are in games.
The Standard puts things the same way, config files go in one place, critical programmes in one place, optionals in one place. Splitting them does two things, puts them in standard places, and also seperates should you decide to partition a disk to have a disk per root branch.
As weibullguy said, linux is deliberate about how it sets things out in a security context; imagine having all programmes and files in one place (a la Windows) and then finding either some malicious user/attacker or accident has damaged this one place. In such a situation, as us in the business would tell you, you're flumped.
I also think a lot of the design decisions for the traditional unix hierarchy have been lost through the ages. But I imagine it started out with "hello, world", which had two parts, source code and a binary file after being compiled. After things got more complex, it was like, "oh, we also now have documentation we should stick somewhere". Then "Oh, wouldn't it be nice if we split out some configuration so you didn't have to recompile every single time you change a message print to stdout". Then "Oh, program foo can share this same compile time library with program bar, maybe we should put shared libraries somewhere else so they're easy to find", etc, etc.
So I'm sure it developed in a perfectly sensible way at the time, even if it doesn't seem that way to you now. But there's no denying that it ended up being very useful for security, even if it is a bit harder to weed out pieces without using your package manager. But I still would rather have orphaned files than have to mess with the windows registry. Needing a registry entry for every user on a machine and the general machine drives me crazy...
In windows, if something goes wrong, I just zoom over to the directory the program was in, delete it and am done, typically. The thought of something going wrong with the program managers for Linux is horrendous.
that was true in the DOS windows 3.x days, but has not been true since windows 95.
Windows apps put files and application information in many locations throughout your system leaving much of it behind even when uninstalled using add/remove programs
Code:
The program directory,
c:\program files\<application Name>
Registry keys in the registry
Shared files in
c:\Windows\System32
User files \ profiles application data
c:\documents and settings\username\application data\<somefolder>
c:\documents and settings\username\local settings\application data\<some folder>
Deleting the folder for the application from program files will remove the bulk of the application but leaves behind shared files in the System 32 directory not to mention how windows apps load the registry with entries that even when un-installed properly those keys are left behind,
Just don't want you to be confused and think that Microsoft manages application files with some simplistic method of everything in one folder.. it doesn't.
Where in the Linux Filesystem Hierarchy should one store user application data, such as the files for a financial accounting system. I understand that database files that belong to a database engine, such as for mySQL, will be automatically stored in the right place (such as /var/lib/mysql), but I was thinking of flat files.
Potential candidates I can see are /usr /var or /srv If so, would application files go into one of the classic subdirectories such as /usr/share or /var/lib ?
Another vaguely related question: is /pub part of the standard hierarchy? I did not see it mentioned in the documentation but it seems to be a very common directory in ftp sites that I visit. It does not get created at install time with any of the distros I have used.
Pub just means public =P Usually associated with anonymous users or... well lets just stick with anonymous users. IMO the linux hierarchy isn't so bad once you get used to it, well it seems to have grown on me. I like where things are stored, you get used to the locations...like if you wanted to modify a program you will know what files are where and what they do by the location, and I think that's good. Instead of having a muck of files in one place and not exactly knowing what controls what. Granted windows made file types, though sometimes the files aren't in the bulk folders...in linux they are always where they should be, or they wouldn't work. haha
Any hints on the other question: Where in the Linux Filesystem Hierarchy should one store user application data, such as the files for a financial accounting system. I understand that database files that belong to a database engine, such as for mySQL, will be automatically stored in the right place (such as /var/lib/mysql), but I was thinking of flat files.
Potential candidates I can see are /usr /var or /srv If so, would application files go into one of the classic subdirectories such as /usr/share or /var/lib ?
User application data should be stored somewhere in user's home directory (/home/username). All user specific data should go there. Unless I misunderstand your question - then please clarify what do you mean by "financial accounting system". I take that it's an application like gnuCash or kMyMoney2.
User application data should be stored somewhere in user's home directory (/home/username). All user specific data should go there. Unless I misunderstand your question - then please clarify what do you mean by "financial accounting system". I take that it's an application like gnuCash or kMyMoney2.
I was thinking of a useland application, rather than system software, for a system used by several people in an organisation - say the whole accounts receivable department. Puting stuff in /home/... would mean granting access rights to other usernames. But using a system directory, might not be ideal either. Perhaps /usr is the place. I thought there might be a standard, or perhaps part of the Filesystem Hierarchy Standard for this sort of use?
1. create a separate user like MySQL or Oracle would, and all the data files belong under there. Possibly also the binaries, but in separate subdirs, ditto config. Similar to Linux, but ultimately under one top dir.
2. use the /usr/local area
3. /opt is popular also
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.