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
Creating a File  
Of course, the easiest way to create a file is to use a word processor like vi or emacs. However, there are a few utilities which you can use to create files from the command line as well.

The "touch" Utility
The touch utility simply creates an empty file of a given name using the syntax:

touch filename


[touch Example]

[Spacer] As you can see from the example above, if the file already exists, it will modify the access time without changing the contents of the file.

The touch utility offers the following options

touch [options] MMDDhhmmYY filelist

Option Explanation
-a Specifies the access time
-c Instructs touch to not create a file not specified in the list
-m Specifies the modify time
MMDDhhmmYY The time and date for setting files
filelist Space delimited list of files to apply time to.

Using Redirection
A more useful tool for creating files from the command line is redirection. Typically, you will use redirection to save the output of a command in the body of a file. for example, check out how we use redirection in the following example to crate a file with the directory listing.

[Example of output redirection]

Previous | Next | Table of Contents