Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Creating a File

July 19, 1998

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

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]

Additional Resources:

Reading a File
Introduction to UNIX for Web Developers | Table of Contents
Copying Files


Up to => Home / Internet / UNIX / Intro




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers