LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux general structure (https://www.linuxquestions.org/questions/linux-newbie-8/linux-general-structure-327086/)

woranl 05-25-2005 04:05 PM

Linux general structure
 
I've been using linux for a while, but still couldn't completely get used to the linux overall structure...

For example, the folder of /etc , /var , /bin , /sbin, /usr
what are they and why is it organized that way?

Sometime I found it's real difficult to find a file within the system... is there an effective way to search files (beside whereis) ?

marghorp 05-25-2005 04:20 PM

I got a good idea of the organization in the book The Linux Bible. it explains what the directories are for and why in this way.

/etc is the directory where all the configuration files are (ussualy if not set up differently)
/var holds many different variables as the name itself explains. Logs are found here.
/bin holds binary executable files (probably all unix machines do not differ in this directory much. Many same programs will be found here as this is the base command set)
/sbin holds many other binary commands, that you might find or might not find on different machines running UNIX
/usr holds the user installed programs, usually if not set different.

I suggest you start with a book on Linux. It will explain a lot to you.

jonaskoelker 05-25-2005 04:21 PM

fs layout:
/etc: configuration files
/var: variably sized files, such as logs and ./www/
/bin: programs
/sbin: more programs
/usr: user-space stuff;
/usr/bin is programs
/usr/share/doc is documentation
/usr/local/bin even more programs.
/proc and /sys: system information. Don't mess with it unless you know what you're doing.
/home/(username)/: `My documents'
/home/(username)/bin: you guessed it: programs (*)
(*) well, this is up to the user, but I do it, so everybody else must do the same (by logic *cough* reasoning)

finding files:
try `locate' and `find'. locate is much faster, but it needs to update a database of file names (that is, if you made recent changes to the fs structure, it might produce a wrong result).
find: slower, always correct, more expressive.

non-general-purpose searching: `which'. returns you the path of the program (/foo/bar/baz) matching a `call' to that program ($ bar)
(in other words, typing foo at the prompt will run $(which foo)

--Jonas

btmiller 05-25-2005 07:28 PM

Also the definitive, pedantic reference is the filesystem hierarchy standard. It goes into this in exhausiting detail.

jonaskoelker 05-26-2005 05:14 AM

That's a great reference, btmiller--thanks a bunch.


All times are GMT -5. The time now is 05:38 PM.