I'm really new to Linux, but I want to learn.

Oct 19, 2005
56
0
0
For reference I'm using Mandriva 2005 edition, haven't got around to updating yet...

I've liked using Linux and all its programmes so far, and now I'd like to get to grips with the OS on a slightly deeper level. Can you guys explain Linux's filesystem to me?

I'm fairly confused about the whole thing, what are things like the Bin directories and all that? I'm just looking for someone to explain the overall philosophy behind it with a few examples please. I guess I'm too used to Windows (which seemed more simplistic).

Cheers, TGG.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
For the most part, Linux and Unix follow the Filesystem Hierarchy Standard. Not always, but mostly. You can find lots of reading on the philosophy of the filesystem design there. It's all pretty sensible once you get the hang of it.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
if you check out my sig there is guides on tldp.org that help a lot with getting a deeper knowledge of Linux.

They have a guide specificly on the Linux filesystem also.

But basicly...

/bin --- user programs that are more nessicary to getting basic functionality.

/boot --- holds files nessicary for boot time. Kernel images, initrd images, etc

/etc --- most system wide configuration stuff can be found here. Configurations for services, boot time configurations, multiuser programs and so on and so forth. Most everything is stored in plain text files. Whenever editing files in this directory always make backups.. that way if you mess up you can copy the original back over it and undo your changes. This is roughly the same as the Windows registry.. at least the non-user configuration part of it.

/lib --- shared libraries more nessicary for system functionality. Libraries are files that contain functions and code that can be easily used by other programs. Instead of rewriting or copying and pasting code into lots of different programs they can instead just use the functionality provided by libraries. They are pretty much like DLL files in Windows.

/proc --- This is a place for the kernel to output information. These are special files that exist in memory-only that contain usefull information. For instance in /proc/cpuinfo you can find the current clock speed and other information about the cpu. /proc/meminfo can show you important statistic on memory usage.

/sys --- This is sort of like /proc, but is something that is relatively new for 2.6 series kernels. It provides a easier way for programs to interact with device drivers and to get settings from the kernel. These again are all virtual files that are usually text. From this directory you will find lots and lots of different files representing different aspects from the kernel. Mostly it's only going to be usefull for programmers, but occasionally there are interesting files. For instance you can control your cpu speed by writing the speed you want to a paticular file.

/root -- Home directory for the root user. (root is basicly a administrator account on steriods. Nothing can stop root from doing what he wants to do. He can delete the entire operating system with one command if root felt like it, which is something that is suprisingly easy to do accidently.. so only use root if you realy realy realy have to.)

/tmp -- scratch place for temporary files. mostly files are created by programs, but you can use /tmp to for normal day to day stuff that you don't want to stick around. Anything in there will eventually get deleted automaticly.

/home -- this directory contains home directories for users. These home directories and /tmp are generally the only areas that users are allowed write access to. Also if you see ~/ that is short for your user's home directory. So if your go 'cd ~/' it will send you to your home directory.

Also in this directoy is were all your user's configurations and preferences are stored. These are stored in .filename .directoryname directories and files. The dot before the name makes them 'hidden', which is just a convienience thing so that you don't see all these files normally and they are out of your way. To see them you go 'ls -a ~/'

sbin --- This contains important files that are generally only for administrators.

usr --- This contains most of your programs that you use. Sort of like the programs directory in Windows. In it are /usr/lib, /usr/bin, /usr/sbin, and so on and so forth.

These directories do the same as ones found in the / directory, but are not so nessicary for basic functionality. This makes it easier for administrators to set things up like having remote application server, or have the operating system boot from a remote server and weird things like that.

Generally you don't have to worry about /usr directory. (like most directories). But also there is a /usr/local/ directory that is designed to allow administrators to easily install programs and other things that are not going to conflict with what your distro has setup.

/dev --- these are special 'device' files. Again virtual files. These represent hardware resources and other special files.
For instance /dev/hda will represent your primary master ide device. (usually your harddrive). /dev/zero represents 'infinate zeroes' and /dev/random is a nice place to get completely random information from for seeding applications like games or encryption programs.

/media --- a newer one, aviable at least in my debian system (don't know how standard it is yet), but is a convient directory for mount point for cdroms and usb devices and such.

Mount points are directorys that are used to mount file systems. Linux doesn't use drive letters like Windows. Instead the directory tree is used were any file system, remote or local, can be mounted to any directory to make it accesable to end users.

For instance I like to make /home a seperate directory so that if I want to try out different Linux versions I can format out the rest and install a new OS without losing any of my user's files or preferences. All that is needed to do is to setup my home partition to mount at /home and change the permissions to match the new install. It can even be a remote system mounted over NFS or something.

/mnt --- a conveint mount point for administators to use for most anything.

/var --- a directory that is ment for more dynamicly program created files and such. It's kinda like you stick things there that don't go anywere else. For instance /var/log have lots of log files for your system and such. It's for system-wide things though.

There are a few things like /opt and such that are paticular to one distro or another.

There is no hard and fast rule on things HAVE to be like that. It's all very configurable and these setups are just ones that people agree on since they work and are flexible across many different setups. For instance if you wanted to make a /PROGRAM directory and install everything in there then you could. But it realy doesn't make sense to do so.

Hope that helps.
 

DasFox

Diamond Member
Sep 4, 2003
4,668
46
91
TheGingerbreadGenius if you are really serious to learn Linux, then JOIN ----> irc.freenode.net

ALOHA
 

P0ldy

Senior member
Dec 13, 2004
420
0
0
Originally posted by: drag
/home -- this directory contains home directories for users. These home directories and /tmp are generally the only areas that users are allowed write access to. Also if you see ~/ that is short for your user's home directory. So if your go 'cd ~/' it will send you to your home directory.
Or just 'cd ~' or 'cd' on most distros I've seen.

I second drag's rec to check out the docs in his sig--Linux Administrator's HOWTO in particular. It explains things very well, even if a little incomplete (when I last read it).
 

Ausm

Lifer
Oct 9, 1999
25,213
14
81
Originally posted by: drag
if you check out my sig there is guides on tldp.org that help a lot with getting a deeper knowledge of Linux.

They have a guide specificly on the Linux filesystem also.

But basicly...

/bin --- user programs that are more nessicary to getting basic functionality.

/boot --- holds files nessicary for boot time. Kernel images, initrd images, etc

/etc --- most system wide configuration stuff can be found here. Configurations for services, boot time configurations, multiuser programs and so on and so forth. Most everything is stored in plain text files. Whenever editing files in this directory always make backups.. that way if you mess up you can copy the original back over it and undo your changes. This is roughly the same as the Windows registry.. at least the non-user configuration part of it.

/lib --- shared libraries more nessicary for system functionality. Libraries are files that contain functions and code that can be easily used by other programs. Instead of rewriting or copying and pasting code into lots of different programs they can instead just use the functionality provided by libraries. They are pretty much like DLL files in Windows.

/proc --- This is a place for the kernel to output information. These are special files that exist in memory-only that contain usefull information. For instance in /proc/cpuinfo you can find the current clock speed and other information about the cpu. /proc/meminfo can show you important statistic on memory usage.

/sys --- This is sort of like /proc, but is something that is relatively new for 2.6 series kernels. It provides a easier way for programs to interact with device drivers and to get settings from the kernel. These again are all virtual files that are usually text. From this directory you will find lots and lots of different files representing different aspects from the kernel. Mostly it's only going to be usefull for programmers, but occasionally there are interesting files. For instance you can control your cpu speed by writing the speed you want to a paticular file.

/root -- Home directory for the root user. (root is basicly a administrator account on steriods. Nothing can stop root from doing what he wants to do. He can delete the entire operating system with one command if root felt like it, which is something that is suprisingly easy to do accidently.. so only use root if you realy realy realy have to.)

/tmp -- scratch place for temporary files. mostly files are created by programs, but you can use /tmp to for normal day to day stuff that you don't want to stick around. Anything in there will eventually get deleted automaticly.

/home -- this directory contains home directories for users. These home directories and /tmp are generally the only areas that users are allowed write access to. Also if you see ~/ that is short for your user's home directory. So if your go 'cd ~/' it will send you to your home directory.

Also in this directoy is were all your user's configurations and preferences are stored. These are stored in .filename .directoryname directories and files. The dot before the name makes them 'hidden', which is just a convienience thing so that you don't see all these files normally and they are out of your way. To see them you go 'ls -a ~/'

sbin --- This contains important files that are generally only for administrators.

usr --- This contains most of your programs that you use. Sort of like the programs directory in Windows. In it are /usr/lib, /usr/bin, /usr/sbin, and so on and so forth.

These directories do the same as ones found in the / directory, but are not so nessicary for basic functionality. This makes it easier for administrators to set things up like having remote application server, or have the operating system boot from a remote server and weird things like that.

Generally you don't have to worry about /usr directory. (like most directories). But also there is a /usr/local/ directory that is designed to allow administrators to easily install programs and other things that are not going to conflict with what your distro has setup.

/dev --- these are special 'device' files. Again virtual files. These represent hardware resources and other special files.
For instance /dev/hda will represent your primary master ide device. (usually your harddrive). /dev/zero represents 'infinate zeroes' and /dev/random is a nice place to get completely random information from for seeding applications like games or encryption programs.

/media --- a newer one, aviable at least in my debian system (don't know how standard it is yet), but is a convient directory for mount point for cdroms and usb devices and such.

Mount points are directorys that are used to mount file systems. Linux doesn't use drive letters like Windows. Instead the directory tree is used were any file system, remote or local, can be mounted to any directory to make it accesable to end users.

For instance I like to make /home a seperate directory so that if I want to try out different Linux versions I can format out the rest and install a new OS without losing any of my user's files or preferences. All that is needed to do is to setup my home partition to mount at /home and change the permissions to match the new install. It can even be a remote system mounted over NFS or something.

/mnt --- a conveint mount point for administators to use for most anything.

/var --- a directory that is ment for more dynamicly program created files and such. It's kinda like you stick things there that don't go anywere else. For instance /var/log have lots of log files for your system and such. It's for system-wide things though.

There are a few things like /opt and such that are paticular to one distro or another.

There is no hard and fast rule on things HAVE to be like that. It's all very configurable and these setups are just ones that people agree on since they work and are flexible across many different setups. For instance if you wanted to make a /PROGRAM directory and install everything in there then you could. But it realy doesn't make sense to do so.

Hope that helps.

WOW Copy pasted and sent that to some Linux n00bs I know. Excellent write up and explanation.

Ausm

 
Oct 19, 2005
56
0
0
Thanks a lot for the replies people. Sorry I didn't reply before- School work.

drag's post helped a lot, but what exactly is 'mounting'?

I'm also gonna check out HP's Linux course and the Guides.

Thanks a lot.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |