[Shenlug] BASICS: The Contents of the Root Directory of Your Linux System

Don E. Groves, Jr. dgrovesjr at gmail.com
Sun Apr 5 15:34:20 EDT 2009


Some minor changes and updates that have happened over the years.

On Sat, Apr 4, 2009 at 1:27 AM, Alvin Smith <mezzenger at gmail.com> wrote:

> BASICS: The Contents of the Root Directory of Your Linux System<http://www.facebook.com/home.php?ref=home#/note.php?note_id=80120770125&ref=nf>
>
>  Every Linux distribution has file structure that is defined by a
> convention established by the designers of the UNIX operating system back in
> the 1970's.
>
> Here are descriptions of all the major top level directories which you will
> find in the root (/) directory on your Linux system and a brief description
> of each directory:
>
> */bin *
> All of the essential user programs are contained in the /bin directory,
> these files represent the bare minimum set of tools required to use a Linux
> system. Tools like the shell and the file system commands (ls, cd, rm, cat )
> are stored here.
>
> The /bin directory usually doesn't receive modification after installation,
> except if they are updated in a major release of the operating system. Many
> of these programs work the same way they did back in the 70's in the
> earliest versions of UNIX.
>


Yes this was and is still generally still true, but some distributions
and/or package for such NOW put additional "program" files in this
directory.


>
> */boot *
> Files that are used by the Boot Loader (e.g. GRUB), including the kernel
> files that are required to start . The boot directory requires little
> modification after the installation of the operating system, except when a
> new version of the kernel is released.
>

Yes, but GRUB(s) support files  other then it's installer files are normally
put in /boot/grub by default.


> Storing the kernel files in the /boot directory instead of the root allows
> for dual-booting.
>

NO it doesn't in anyway help with DUAL-booting.

Using a "bootloader" such as GRUB (or one of the other fine bootloaders) is
what allows the ablity to Dual-boot .

The only reason /boot is used to store the files system version of the
Kernel and it's support files is to make keeping track of the files
(bookkeeping) easier. (the kernel itself is always in the system memory
while the system is running.)


> NOTE: if you want to dual-boot with a version or multi-boot versions of
> windows, install all of the windows versions first starting with the oldest
> (i. e. 98SE, NT4, 2000, XP, Windows Server 2003, Vista, 2008 . . . )
>

This is only because the default Microsoft Windows likes to by default
overwrite the Master Boot Record(MBR) without asking before hand and that
most of the "Window's Image" type installers supplied by most/some
*Manufacturers
likes to WIPE the drive and write there image to the device.*


>
> */dev *
> Again, remember everything in Linux is a file, even hardware devices like
> serial ports, hard disks, and scanners. In order for you to be able to
> access these devices, a special file called a device node has to be present.
>

This is only the DEFAULT location that these special files are stored, but
NOT a requirement.


> All device nodes (BY DEFAULT) are stored in the /dev directory.
>

And then on newer versions there the 'udev' program(deamon) that creates
Devices files (in /dev by default<G>) as they are found and/or accessed.

What about the newer /sys directory?
        (see later on)


> */etc *
> Linux system configuration files are stored in the /etc directory. For
> example, the X Windows configuration file, the user database, web server
> controls and systems startup scripts all reside under the /etc directory.
>
> */home *
> Linux is a true multiuser operating system, every user on the system is
> given an account and a unique home directory (/home/their-name) for personal
> files. User home directories contain the files that are located on user's
> desktop and other personal files in their home folder. If you plan to have a
> lot of users on your system /home should be assigned to it's own hard disk
> drive or drive partition.
>
> */lib *
> Required operating systems libraries are found in the /lib directory. These
> include the C programming language library, the dynamic loader, other
> systems libraries, and kernel modules.
>

*/lost+found*
Directory for lost files. Every disk partition has a lost+found directory.


>
> */mnt *
> Directory containing the temporary mount points for working on hard disks
> or removable drives.
>

Also some distributions now use;
/media
  Directory for mounting files systems on removable media like CD-ROM
drives, floppy disks, and Zip drives.


>
> */opt *
> Optional software packages can be installed here to make them easy to
> remove later, you are free to add anything you want to /opt.
>
> */proc *
> Various pieces of information that the kernel wants you to know are
> accessed via files in the /proc directory. You can also send information to
> the kernel through some of these files. For example type: cat /proc/cpuinfo,
> and you will see information about your system displayed for you.
>

*/srv*
Contains data for services (HTTP, FTP, etc.) offered by the system.

/sys
The */sys* directory is a cousin to */proc*, only it's well-organized rather
than a chaotic mess. It exports kernel information into a human-browseable
and program-parseable structure. Just like */proc* uses the /proc
filesystem, the */sys* directory uses *sysfs*.
 (see: <http://www.enterprisenetworkingplanet.com/nethub/article.php/3635686>
for further information on this sub-subject.)



> */root *
> Linux's system administrator ( a. k. a. the super user) logs in as the
> root, therefore in order to maintain order the super user's home directory
> is kept in /root separate from the other users( /home). which allows you to
> keep the user directories under /home on a different physical piece of
> hardware then the super user's home directory.
>

FUNNY I'm currently running a "unix" like operating system on one of my
systems and there is no "/root" directory on it.
   The "root" users home directory is /var/root.
    Can you tell me what operating system, I'm most likely running on that
hardware? It is a KNOWN version and comes standard on the supplied hardware.


>
> */sbin*
> Essential programs that are run by root and during the system bootup
> process are kept here in /sbin. Only the super user can run programs in this
> directory
>

Generally true, but some distributions now store some regular users programs
in this area.  Plus programs such as "/sbin/ifconfig"(for example) can be
ran for usefull proposes by normal users.

, the super user login name is always "root".
>

NO the "super user" has the userID of 0 (zero) and by default it's called
"root", but nothing other then possible a few misconfigured programs in any
way make this a requirement.


> */tmp *
> The temporary storage location. All users have read and write access to
> this directory.
>
> */usr *
> Slash usr (/usr) is the big directory on a Linux system, this is where
> applications are installed. For example: source code, executable code,
> documentation, the kernel source code, and the X Window system.
>


>
> */var *
> Another big directory branch which includes System log files, cache data,
> and program lock files are stored here. This is the directory for
> frequently-changing data for example systems logs and web sites.
>

"web sites"??  Please explain.
As by default the only "normal" user writeable directory under /var is
/var/tmp


>
> */var/www*
> This is the default root directory for your web server, where you would
> place your home page in this directory and the create sub-directories for
> your web site(s).
>

That all depends on the distribution (and version) that you are running
and/or which WEB-server (version and how configured), is installed.

For additional information on this subject see:
http://slashmedia.wordpress.com/2007/12/23/linux-directory-structure/

Or
Filesystem Hierarchy Standard <http://www.pathname.com/fhs/pub/fhs-2.3.html>


-- 
--
Don E. Groves, Jr.

Tag it's your turn now... ... ....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://calypso.tux.org/pipermail/shenlug/attachments/20090405/8cba3b93/attachment-0001.html 


More information about the Shenlug mailing list