lin-club  

Re: [Haifux] RFC: Summary of the Basic Use Lecture

Nadav Har'El
Fri, 21 Sep 2001 14:19:06 -0700

On Fri, Sep 21, 2001, Adir Abraham wrote about "Re: [Haifux] RFC: Summary of the Basic 
Use Lecture":
> >         - Making backups of all the files:
> >             for I in *.c ; do cp $I $I.bak ; done
> >             (this diverts into shell scripting, but we should do it to
> >             demonstrate the power of the UNIX shell)
> Creating backup is not a subject for beginners (basic use) in my opinion.
> Moreover, you might get them scared if you start talking about backups :)

The first time I accidentally erased over half of my files was roughly
6 months after I started using Unix. At that time I was a complete computer
novice, and never even thought of making backups for myself. Only A year
later, in 1985, the timesharing computer that I had used (a VAX running AT&T
8th edition research UNIX) got a central backup on a 3 gigabyte WORM
(write once read many) optical disk, but that was too late for me...

Of course, after that incident I never forgot to backup again. Ever.. Using
various approaches, but none as simplistic as your "cp $I $i.bak" example.
The easiest type of backup is using RCS (or whatever similar program) on
most files, which eliminates the common "oops, I just ruined the code I've
been working on for a week!". But you also need to make backups on other media
and/or computers, because disk failures, cracking, and other types of crimes
and natural desaster do happen, unfortunately.

So it's good to recommend backing up, but it's not exactly a Linux specific
issue. Of course the fact that there is no "garbage can" or "undelete" in
Linux makes deletion very dangerous in Linux. The specific command that lost
me half my files back in 1984 was something like

        rm xy *

note the extra space character :( I meant to remove all files starting with
xy, but it removed everything. Luckily (?) the computer was very slow back
then, and when I interrupted it it only managed to delete files beginning
with a through l...

P.S. In zsh, and perhaps in other shells, it is possible to press a <TAB>
after the "*" character, and the glob patter is replaced immediately by
the completion list, so you can check that you got the correct list BEFORE
you press enter. Nowedays I never ever press enter on any command that
contains a "*" before I let zsh complete it for me. As they say, he who
got burned with hot water is now careful about cold water...

-- 
Nadav Har'El                        |     Saturday, Sep 22 2001, 5 Tishri 5762
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |The world is coming to an end ... SAVE
http://nadav.harel.org.il           |YOUR BUFFERS!!!

--------------------------------------------------------------------------
Haifa Linux Club Mailing List (http://linuxclub.il.eu.org)
To unsub send an empty message to [EMAIL PROTECTED]