LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GNU-Linux File Structure (https://www.linuxquestions.org/questions/linux-newbie-8/gnu-linux-file-structure-4175630409/)

saeed7r 05-24-2018 04:40 PM

GNU-Linux File Structure
 
Linux File structure is kind of up side down instead of programs and libraries be in a folder with their names on it and in them have lib var ... folder there are global var lib ... folders and program distribute their files inside of it. this confuses me how can I find files for my programs through all of these sym-linkes generated by installing system(apt for me) and how do know what libraries are linked automatically by compiler?

keefaz 05-24-2018 04:50 PM

The idea is to share globally functions and resources for programs (functions from libs, images from graphics files, text, anything that can be accessed)

jefro 05-24-2018 05:10 PM

I kind of agree with you on this subject. It could be rather trivial to have installers perform a task like you wish but there is little technical side support for it.

Things like Snaps are an idea that may win over but there is competition on every change.

adps8 05-24-2018 08:37 PM

Hi, I'm new on the forum so, and not so old on GNU/Linux world, sorry for any inconvenience. Well, as keefaz says, the idea is to share functions, so Linux and other UNIX like systems do almost the same. In my opinion all you have to do is understand the The Filesystem Hierarchy Standard (FHS), understand what's the general purpose of the directories and so on.
For this:
Quote:

(...)and how do know what libraries are linked automatically by compiler?
linuxubuntu saeed7r is online now Report This Post(...)
I suggest you read the documentation of your software and try to understand what they're doing. And of course, participate on theses forums to clarify the things.

frankbell 05-24-2018 09:16 PM

This is a good introduction to the Linux file structure: https://www.howtogeek.com/117435/htg...ure-explained/

The underlying philosophy is that like files are stored in similar locations. Hence, executables are in /bin or /usr/bin. Libraries (similar to DLLs in Windows world) are in "lib" and "share" directories, depending on their function. And so on.

There is also history. Unix--and Linux was written to Unix standards--has been around for a long time. When hard drives were very small, Unix could be configured so that different directories could be on physically separate hard drives. That's one reason /bin (generally executables required for booting and administration) is separate from /usr/bin (executables expected to be used by users).

Frankly, once I got used to it, I concluded that the Linux file structure is more rational than the DOS/Windows file structure.

That's one reason I'm not all fired up about things like snaps. They seem to be a good example of "if it ain't broke, fix it."

But that's just me.

saeed7r 05-24-2018 11:50 PM

Quote:

Originally Posted by frankbell (Post 5858983)
This is a good introduction to the Linux file structure: https://www.howtogeek.com/117435/htg...ure-explained/

The underlying philosophy is that like files are stored in similar locations. Hence, executables are in /bin or /usr/bin. Libraries (similar to DLLs in Windows world) are in "lib" and "share" directories, depending on their function. And so on.

There is also history. Unix--and Linux was written to Unix standards--has been around for a long time. When hard drives were very small, Unix could be configured so that different directories could be on physically separate hard drives. That's one reason /bin (generally executables required for booting and administration) is separate from /usr/bin (executables expected to be used by users).

Frankly, once I got used to it, I concluded that the Linux file structure is more rational than the DOS/Windows file structure.

That's one reason I'm not all fired up about things like snaps. They seem to be a good example of "if it ain't broke, fix it."

But that's just me.

Your answer makes very good sense to me was there any standard documentation that could've read so I wouldn't ask this thread, like posix? or did you came to this all by experience?

hydrurga 05-25-2018 08:55 AM

In case it may answer at least a part of your question ("how can I find files for my programs"), on a dpkg-based system you can determine which files are installed by a certain package with the following command:

Code:

dpkg-query --listfiles package_name


All times are GMT -5. The time now is 09:14 PM.