Snalk

Snalk » Reviews » Hardware review » The file hierarchy

Reply
  #1 (permalink)  
Old 10-24-2008, 09:24 AM
Junior Member
 
Join Date: Oct 2008
Posts: 9
Lightbulb The file hierarchy

The main subdirectories of the root directory together with the most important file are shown below. Their contents are as follows.

• /bin Executable (binary) programs. On most systems this is a separate directory to /usr/bin. In SunOS, this is a pointer (link) to /usr/bin.

• /etc Miscellaneous programs and configuration files. This directory has become very messy over the history of Unix and has become a dumping ground for almost anything. Recent versions of Unix have begun to tidy up this directory by creating subdirectories /etc/mail, /etc/inet etc.

• /usr This contains the main meat of Unix. This is where application software lives, together with all of the basic libraries used by the OS.

• /usr/bin More executables from the OS.

• /usr/sbin Executables that are mainly of interest to system administrators.

• /usr/local This is where users’ custom software is normally added.

• /sbin A special area for (often statically linked) system binaries. They are placed here to distinguish commands used solely by the system administrator from user commands, and so that they lie on the system root partition, where they are guaranteed to be accessible during booting.

• /sys This holds the configuration data which go to build the system kernel.

• /export Network servers only use this. This contains the disk space set aside for client machines which do not have their own disks. It is like a ‘virtual disk’ for diskless clients.

• /dev and /devices A place where all the ‘logical devices’ are collected. These are called ‘device nodes’ in Unix and are created by mknod. Logical devices are Unix’s official entry points for writing to devices. For instance, /dev/console is a route to the system console, while /dev/kmem is a route for reading kernel memory. Device nodes enable devices to be treated as though they were files.

• /home (Called /users on some systems.) Each user has a separate login directory where files can be kept. These are normally stored under /home by some convention decided by the system administrator.

• /root On newer Unix-like systems, root has been given a home-directory which is no longer the root of the filesystem ‘/’. The name root then loses its logic.

• /var System V and mixed systems have a separate directory for spooling. Under old BSD systems, /usr/spool contains spool queues and system data.

/var/spool and /var/adm etc. are used for holding queues and system log files.

Every Unix directory contains two ‘virtual’ directories marked by a single dot and two dots.
ls –a
. ..
The single dot represents the directory one is already in (the current directory). The double dots mean the directory one level up the tree from the current location. Thus, if one writes

cd /usr/share
cd ..


The final directory is /usr. The single dot is very useful in C programming if one wishes to read ‘the current directory’. Since this is always called ‘.’ there is no need to keep track of what the current directory really is. ‘.’ and ‘..’ are hard links to the current and parent directories, respectively.
Reply With Quote
Reply

Bookmarks

Tags
file, hierarchy, networking

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump



All times are GMT. The time now is 07:11 AM.
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.