eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
Resources
 ::   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
Deleting Files  
The "rm" utility is used to delete files. As a warning, in UNIX there is no easy way to recover a deleted file unless you have it saved in a backup. So be very careful when using this command.

rm follows the standard form of:

rm [options] space_delimted_filelist

The rm utility has three extremely useful options

Option Explanation
-r Deletes in a recursive manner including whole directories. Obviously you should be extremely careful with this option.
-i Specifies that you wish to reconfirm each file before it is deleted. This is a particularly useful option if you are deleting using -r or with wild cards.
-f Bypasses the prompt when deleting against permission.
-- Specifies that the options are over if necessary

[rm Example]

It cannot be said too forcefully that you should be extremely careful when using wildcards with "rm". in particular, you should try not to use the rm utility like "rm *' or "rm -r *" unless you really, really, really know what you are doing AND you have already backed up the data you are deleting. If you delete files by mistake, and you have not made your own backup, your own recourse is to hope that your system administrator has backed up the system for you.

One deeply evil mistake is when you mean to type "rm *.bak" and instead you type "rm * .bak". Notice the accidental space between the "*" and the ".bak". If you do this, all your files will be erased and you will get an error message saying that the file .bak does not exist. Believe me, this is easy to do...I have done it twice to my great dismay. So be very careful. It is always safer to use the "-i" option when you use rm's with wild cards.

Previous | Next | Table of Contents