eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
 ::   Tutorials
 ::   Presentations
Perl & CGI tutorials
 ::   Intro to Perl/CGI and HTML Forms
 ::   Intro to Windows Perl
 ::   Intro to Perl 5
 ::   Intro to Perl
 ::   Intro to Perl Taint mode
 ::   Sherlock Holmes and the Case of the Broken CGI Script
 ::   Writing COM Components in Perl

Java tutorials
 ::   Intro to Java
 ::   Cross Browser Java

Misc technical tutorials
 ::   Intro to The Web Application Development Environment
 ::   Introduction to XML
 ::   Intro to Web Design
 ::   Intro to Web Security
 ::   Databases for Web Developers
 ::   UNIX for Web Developers
 ::   Intro to Adobe Photoshop
 ::   Web Programming 101
 ::   Introduction to Microsoft DNA

Misc non-technical tutorials
 ::   Misc Technopreneurship Docs
 ::   What is a Webmaster?
 ::   What is the open source business model?
 ::   Technical writing
 ::   Small and mid-sized businesses on the Web

Offsite tutorials
 ::   ISAPI Perl Primer
 ::   Serving up web server basics
 ::   Introduction to Java (Parts 1 and 2) in Slovak


Introduction to UNIX for Web Developers
Relative and Absolute Paths  
The first thing we need to understand is how the file system is addressed. That is, how do you know where within the file system you are or where your file is located?

UNIX has an address system based upon file paths. A file path specifies the route that you need to take in order to find a file within the file tree much like a map directs you from one location to another.

In UNIX, all paths start from the "root" directory. The root directory is specified by a single slash "/" character. From there, steps along the path are separated by successive slash characters.

Thus, the path "/usr/selena/public_html/index.html" specifies a file called "index.html" which is located in the "public_html" directory, which is a sub-directory of "selena", which is a sub-directory of "usr", which is itself a sub-directory of "root"!

This type of path is called an absolute path because it references a file or directory absolutely from the root.

However, paths can also be relative to your current location within the file system. To specify a relative path, you do not specify the path from "root" by not including the initial slash character.

For example, if we were currently located in the "selena" sub-directory, we could refer to the file "index.html" using the path "public_html/index.html". Notice that since we do not include the initial "/" UNIX will assume that the specified path is relative to your current location which is "/usr/selena".

Two final important path tools are the ".." and "." notations. In short, ".." stands for the directory directly above the present directory and the "." refers to the present directory.

Thus, if we were in the "public_html" directory from our example above, "./.." would stand for the "selena" directory and "./../.." would stand for the "usr" directory. If this is all a bit confusing now don't worry, you can learn this by actually doing it on a UNIX machine. It will all make more sense when you can do it yourself.

Previous | Next | Table of Contents