open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: Unix File System Names

ITworld 10/31/2007

Sandra Henry-Stocker, ITworld.com

Send in your Unix questions today! | See additional Unix tips and tricks

One of the questions that Unix users are sometimes reluctant to ask is how all the directory names -- like /etc, /var and /usr/local -- came about in the first place. Why did we adopt the particular names we use today instead of names that might make more sense to the casual user? What do these file system and directory names tell us about the intended content?

On this topic

To best understand why particular conventions were adopted, hark back to the early days of Unix and how the systems were used in those days. Back in the "childhood" of Unix, most of its users were researchers who developed their own software. The idea behind the Unix development at the time was, therefore, to provide a rich programming environment so that these early developers could be more productive. The uses and layout of the early Unix file systems reflects this programming mentality.

The /var file system, for example, as named /var (variable) primarily because it was a file system that was anything but static in its content. Unlike /usr which remains fairly stable for any particular release of an operating system, /var changes all of the time as records are added to log files and log files are rotated out to make room for each next generation of log files.

The /usr directory was meant to refer to commands and tools that users execute, not to home directories. On some rare systems, you might find /usr/home set up to contain home directories, but you are far more likely to find home directories in /home or /export/home.

Similarly, /usr/share was meant to house a file system that might be shared with other systems, being architecture-independent. In other words, the content of /usr/share wasn't strictly related to the architecture of the particular system on which it was stored.

The /platform directory is something of the opposite. It houses files which are specific to the hardware of the particular system. The file /platform/sun4u/kadb, for example, is a kernel debugger for Solaris systems in the sun4u series which includes Netras and Enterprise servers.

Directories named /boot or /kernel relate to system booting and the core of the operating system itself.

The /usr/local file system was used to hold files that were unique to some particular site. For example, if your organization were to maintain a set of tools (whether public domain utilities or scripts and programs developed on site) distinct from that which was installed with the operating system, this set of tools might be stored in the /usr/local file system. The "local" in /usr/local does not imply that the file system is stored on the local hard drive. In fact, it is more likely to be mounted from a central file server.

Directories named bin are intended to house binary files. The /bin, /usr/bin and /sbin (system binaries) directories contain the binaries that represent the core of the commands that comprise the OS.

Following this thinking, the /usr/local/bin directory contains binaries for non-OS or "third party" software.

The /etc directory (almost always a directory within the root file system) was originally named to indicate that it was something of a catch-all with respect to content. While today's Unix systems primarily store configuration files and system start-up files in /etc, the focus in those early days seems to have been on the characterization of these files as being different than the binary files that populated most of the other directories on the busily evolving systems. While "et cetera" no longer really captures the sense of what we see today in /etc (generally pronounced "et-see", rhyming with "yet see"), the name has stuck and few sysadmins spend much time wondering at the unusual choice of name.

Since /etc evolved into a directory for storing configuration files, it follows that /usr/local/etc would be used to store configuration files for non-OS tools and utilities. The configuration file for an add-on ssh software, for example, is very likely to be found in /usr/local/etc.

Home directories for users are still primarily set up in /home or some variation of /home. The /export/home convention of Solaris indicates the intention that these home directories be shared over a network and came about with the development of NFS. Like mapped drives on today's Windows systems, the practice if storing user home directories on file servers adds a degree of flexibility to a network. Users don't have to work at a system's console to access their files.

The /opt file system is a relative newcomer to Unix file systems and is primarily used to house optional software packages.

/tmp was and still is, of course, intended for temporary files. It is only in recent years that /tmp on some systems (e.g., Solaris) doubles as swap space.

While I don't know for sure, it is likely that the Oracle convention of naming data partitions /u01, /u02 etc. also reflects the idea that "user" refers to application files rather than to the contents of user home directories. These file systems are generally owned by the oracle user and often consume the bulk of a system's disk capacity.

It's impossible to know exactly what the original developers of Unix were thinking when they laid out the first file systems and the use of these file systems has evolved over time. The names of Unix file systems and directories make sense, especially given just a little historical context.

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Sun Microsystems' - FREE 60 DAY TRIAL OFFER!
Test Sun's Newest Servers BEFORE YOU BUY. Plug Them In With Access To Full Technical Support.
100% Web Based Help Desk Software
Easy to use, customizable to meet your needs, powerful and scalable. Free online demo. Try it today!
Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Used and Refurbished HP ProCurve Switches
Lifetime Warranties, Professional Testing & Shipping on all HP Equipment Purchases!
» Buy a link now

Advertisements
Sponsored links
Locate Hidden Software on business PCs with this free tool
Bring harmony to your mix of UNIX-Linux-Windows computing environments
Top 5 Reasons to Combine App Performance and Security
KODAK i1400 Series Scanners stand up to the challenge
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.