LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2004, 09:40 AM   #1
ignus
LQ Newbie
 
Registered: Jul 2004
Location: NC
Distribution: SuSe 8.2/OS X 10.3
Posts: 8

Rep: Reputation: 0
basic directory functions


I was wondering if some could say what the main things the directories like usr,var,etc, bin... contain.

I know var is logs and stuff and that etc has to do with things involving users and groups and stuff, but overall I feel I don't know these things well enough.

thanks
 
Old 08-13-2004, 10:20 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Code:
File System Layout
The first noticeable difference between Slackware Linux and a DOS or Windows system is the filesystem. For starters, we do not use drive letters to denote different partitions. Under Linux, there is one main directory. You can relate this to the C: drive under DOS. Each partition on your system is mounted to a directory on the main directory. It's kind of like an ever-expanding hard disk.

We call the main directory the root directory, and it's denoted with a single slash (/). This concept may seem strange, but it actually makes life easy for you when you want to add more space. For example, let's say you run out of space on the drive that has /home on it. Most people install Slackware and make one big root drive. Well, since a partition can be mounted to any directory, you can simply go to the store and pick up a new hard drive and mount it to /home. You've now “grafted” on some more space to your system. And all without having to move many things around.

Below, you will find descriptions of the major top level directories under Slackware.

/bin

Essential user programs are stored here. These represent the bare minimum set of programs required for a user to use the system. Things like the shell and the filesystem commands (ls, cp, and so on) are stored here. The /bin directory usually doesn't receive modification after installation. If it does, it's usually in the form of package upgrades that we provide.

/boot

Files that are used by the Linux Loader (LILO). This directory also receives little modification after an installation.

/cdrom

Remember that all drives have to be mounted to a directory on the main root directory? Well, /cdrom is provided as a mount point for your CD-ROM drive.

/dev

Everything in Linux is treated as a file, even hardware devices like serial ports, hard disks, and scanners. In order to access these devices, a special file called a device node has to be present. All device nodes are stored in the /dev directory. You will find this to be true across many UNIX-like operating systems.

/etc

This directory holds system configuration files. Everything from the X Window configuration file, the user database, to the system startup scripts. The system administrator will become quite familiar with this directory over time.

/home

Linux is a multiuser operating system. Each user on the system is given an account and a unique directory for personal files. This directory is called the user's “home” directory. The /home directory is provided as the default location for user home directories.

/lib

System libraries that are required for basic operation are stored here. The C library, the dynamic loader, the ncurses library, and kernel modules are among the things stored here.

/lost+found

When the system boots, the filesystems are checked for any errors. If errors are detected, the fsck program is run to see if any can be corrected. The corrected parts of the filesystem are written to the /lost+found directory.

/mnt

This directory is provided as a temporary mount point for working on hard disks or removable drives.

/opt

Optional software packages. The idea behind /opt is that each software package installs to /opt/<software package>, which makes it easy to remove later. Slackware distributes some things in /opt (such as KDE in /opt/kde), but you are free to add anything you want to /opt.

/proc

This is a unique directory. It's not really part of the filesystem, but a virtual filesystem that provides access to kernel information. Various pieces of information that the kernel wants you to know are conveyed to you through “files” in the /proc directory. You can also send information to the kernel through some of these “files”. Try doing cat /proc/cpuinfo.

/root

The system administrator is known as “root” on the system. root's home directory is kept in /root instead of /home/root. The reason is simple. What if /home was a different partition from / and it could not be mounted? root would naturally want to log in and repair the problem. If his home directory was on the damaged filesystem, it would make it difficult for him to log in.

/sbin

Essential programs that are run by root and during the system bootup process are kept here. Normal users will not run programs in this directory.

/tmp

The temporary storage location. All users have read and write access to this directory.

/usr

This is the big directory on a Linux system. Everything else pretty much goes here, programs, documentation, the kernel source code, and the X Window system. This is the directory to which you will most likely be installing programs.

/var

System log files, cache data, and program lock files are stored here. This is the directory for frequently-changing data.
 
Old 08-13-2004, 11:36 AM   #3
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Worth having a look at this article - in addition, makes references/comparisons re. Windows.

http://www.freeos.com/articles/3102/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Absolute Newbie - Help with Some Basic Functions Ingla Linux - Newbie 7 10-18-2005 02:07 AM
Crawling a directory and executing Python functions. Travis86 Programming 2 07-06-2005 01:06 AM
debian installation failed: debootstrap/functions no such file or directory lixy Linux - General 1 01-25-2005 05:55 PM
how i can list directory by using read() & write() kernll functions ashamry Programming 2 05-10-2004 01:44 PM
Some basic knowledge of Linux regarding directory structure chem1 Linux - Newbie 3 08-10-2002 11:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration