Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Linux Resources > Linux Tutorials, HOWTO's & Reference Material
Reload this Page Linux Directory Structure Overview
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Tutorials, HOWTO's & Reference Material A useful collection of tutorials, guides and reviews compiled here for easy reference purposes.

 
 
Thread Tools Display Modes
Old 11-23-2003   #1 (permalink)
sarumont
Content Team Leader
 
sarumont's Avatar
 
Join Date: Apr 2003
Location: /dev/urandom
Posts: 3,662
Linux Directory Structure Overview

A brief introduction to the Linux Directory Structure
by: sarumont of the http://www.linuxforums.org team.

Overview

One of the most noticable differences between Linux and Windows is the directory structure. Not only is the format different, but the logic of where to find things is different (read: makes sense ). This tutorial is designed to give you a general understanding of the Linux directory structure and the logic of where to find things.

Note that this structure could vary from distro to distro and this is a very generic guide.

The Format

In Windows, you use this format to access a directory:

Code:
C:\Folder1\subfolder\file.txt
In Linux, this is the basic format:

Code:
/Folder1/subfolder/file.txt
You'll notice that the slashes are forward slashes in Linux versus backslashes in Windows. Also, there is no drive name (C:, D:, etc.) in Linux. At boot, the 'root partition' is mounted at /. All files, folders, devices and drives are mounted under /. Though it is not apparent from this example, it is important to note that files and folders in Linux are case sensitive. /Folder1/subfolder/file.txt is not the same as /folder1/subfolder/file.txt.

Moving and Searching

To learn how to move around and find files in the Linux directory structure (and command line in general), check out flw's tutorial: http://www.linuxforums.org/forum/viewtopic.php?t=1154

The Main Directories

These are the basic directories that you (should) have after installing any Linux distribution:

Quote:
/bin/
/dev/
/etc/
/home/
/lib/
/mnt/
/proc/
/root/
/sbin/
/tmp/
/usr/
/var/
/bin/

This is where all your programs that are accessible to all users will be stored once installed.

/dev/

This is a virtual directory where your devices are 'stored.' Devfs allows Linux to list devices (hard drives, input devices, modems, sound cards, etc.) as 'files.'

/etc/

This is where you'll find all your global settings. Daemons such as ssh, telnet, and smtp/pop3 mail servers find their configuration files here. Also in /etc/ is the system's password file, group lists, user skeletons, and cron jobs.

/home/

This is the default directory where non-root users' homes are created. When you add a user, the default home directory is created as /home/username. You can change this default in the proper file in /etc/.

/lib/

This is where shared libraries (perl, python, C, etc.) are stored. Also in /lib/ are your kernel modules.

/mnt/

This is the default location for mounting cdroms, floppy disk drives, USB memory sticks, etc. You can mount anything anywhere, but by default there is a /mnt/floppy (if you have a floppy drive) and /mnt/cdrom.

/proc/

This virtual folder contains information about your system. You can view processor statistics/specifications, PCI bus information, ISA bus information, and pretty much anything else you want to know about the hardware on your system.

/root/

This is the default home directory for the user root.

/sbin/

This is where system programs are installed. These include fdisk, tools to make partitions, certain network tools, and other things that normal users shouldn't have a need for.

/tmp/

This is the default location to place files for temporary use. When you install a program, it uses /tmp/ to put files during installation that won't be needed once the program is installed.

/usr/

This contains various programs, non-daemon program settings and program resources.

/var/

This is where your log files, system mail messages and database of installed programs are stored.
sarumont is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 04:01 AM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0