• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Gentoo/Linux structure vs. Windows

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Sorin

Member
Joined
Mar 7, 2004
Location
Phoenix, since 03/2014
I've used Linux a few times, and I'm currently in the middle of a stage 1 install of Gentoo. So while it's in the middle of a compiling run, I thought I'd ask a few questions that have been bugging me.

I'd like to know how the hell Gentoo, or Linux in general is structured. The directories and their names haven't been very intuitive or forthcoming in and of themselves, and I've had a lot of trouble trying to figure it out myself.

What I want to know, is what are the equivalencies/comparables of various Windows areas within Linux/Gentoo?

In other words:

Windows:
/Program Files - vast majority of programs you install end up here.
/Windows, /WINNT - the system root folder Windows. Most system files and components are here in this directory.
My Documents - this folder and its subfolders have your saved documents, pictures, and various other things. Your personal little file cabinet or desk drawer.
My Computer - The extreme convenience of being able to see your whole computer in one spot. i.e. all the hard drives, cd drives, usb flash drives you plug in, cameras, floppies, etc. etc.


So for Linux. . . . . .?

Analogies please? And any short descriptions of what's defaultly stored in various folders? like /usr, /bin, /sbin, /tmp, /etc, /local, and so on.

I know my way around windows extremely well........but I find myself stumbling around in Linux for hours on end trying to find things, and having to eventually resort to the search function (in the OS).
 
You can't really do it by analogy. There is no correspondence like that, it's structured totally differently.

Most executables are in /bin, /usr/bin, or /usr/local/bin. The rest of the program is often not with the executable. Sometimes programs are installed in /opt, but not always. /var is for stuff that changes a lot (system things). /etc is a directory that holds a lot of system information, such as password files, services to start when you start linux, configuration settings for make, X, and other programs, etc... lots of config files that you can edit. Your files will generally be stored in your home directory... this is the only directory that the average linux user has write access to. There is a directory called /home. The user directories are off that, like bob's home directory will be /home/bob. /sbin is for system executables that the average user does not need but root would use. /tmp is for temporary files. Many of the files needed to run software are stored in shared libraries in linux, and these are generally found in /lib and dynamically linked on the fly.

I've never been able to get a good explanation of the differences between /bin, /usr/bin, and /usr/local/bin... it seems mostly random to me which one files end up in. Imagine in windows if you took every executable on the hard drive and put it in one directory, and you have the bin directories. (bin stands for binary btw, as in executable).
 
All you really need to know is root is /root and home is /home ;)

Emerge slocate and run "slocate -u"

Then you can run "slocate filename" and find anything you are looking for.
 
As long as you understand that root ( / ) is a filesystem (usually on a harddisk), and that other filesystems (other harddrives, floppy disks, cdroms, etc) can be "mounted" into a folder under it, then you've got the jest of it.

Besides that, there's common directory names that will tip you off:
bin - binaries (linux has no 'exe's.. binaries are compiled files (unreadable to you and I) that can be run)
boot - stuff needed for booting the system (good idea not to toy in here often)
dev - devices.. there is one in here for every piece of hardware in your box, and virtual things like consoles.
etc - configuration files
home - home directories
lib - libraries (keep out of here, it'll maintain itself)
mnt - mount.. the generally-accepted place to mount things
opt - some software likes to install itself here..
proc - process information.. if you ever need to know the ooey gooey details of any process or kernel information, go here. Some kernel-level options can be temporarily set here.
root - the root user's home directory
sbin - superuser binaries.. these are binaries that only root should use
tmp - temporary files (anyone can generally write here)
usr - user files.. usually programs like to install under here /usr/bin, /usr/sbin, /usr/lib, etc.
var - variable files.. a place for constantly-changing files, like logs, databases, spools, etc.

Once you understand what these stand for, then you will be able to read paths easily... /usr/sbin is for non-system superuser binaries. Binaries for services, like a webserver would be installed here.

Most stuff installs itself into /usr in some way, putting binaries into /usr/bin (or /usr/sbin), libraries into /usr/lib, etc.
System-level stuff installs itself into the root /, putting binaries into /bin, libraries into /lib, etc.

If you are a user, you put all your files in your home directory. Generally you don't write anywhere else on the system except for on mounted drives (if you are granted permission), and temp files into /tmp.

The root user is like any other user, except that permissions don't apply. They can write anywhere, read anything. The root user should be used sparingly. You can use SU to switch to root from your regular user when you need to do some system administration, or SUDO if you are only running one command.
 
The answer is going to be a bit more complex than a simple analogy can answer but here's about as close as you're gonna get.

/home/username = my documents and bascially anything for your specific user
/mnt = my computer
/etc/, /usr/sbin, /lib, /boot = Windows directories
/bin, /usr/bin, /opt, /usr/local/bin, /home/username = Program Files
/dev = Device Manager
/etc = registry <-REALLY bad analogy but I can't think of anything else sorry
 
Being as this thread is active and I'm still installing Gentoo.......

I'm on step 8a of the install handbook where I'm looking at the /etc/fstab file and I noticed something bizzare, which alarms me. My root partition somehow ended up as XFS, even though I know damm well I made sure it was Ext3.

So before I go on........WTF!?!? What do I need to do now?
 
just change the entry to ext3, the fstab you're seeing is just an example, you'll have to change it to match whatever you setup your system for.
 
kaltag said:
just change the entry to ext3, the fstab you're seeing is just an example, you'll have to change it to match whatever you setup your system for.

got it, kthx.

Whew, that was scary. I thought I was going to have to start all over or something :eek:
 
Don't be afraid to really change that fstab. The way it is written will not work AT ALL. That's one of the major points I've seen people get hung up on. (Also, don't leave things like /BOOT and /ROOT in there, those are just there to tell you to put in your real boot and root directories, there is no such directory as /BOOT or /ROOT.)
 
well that answers all of my problems with my install...i left /boot and/root /swap in there...i guess thats what i get for stayin up till 4am doin this install lol
 
Back