home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.tek.com!vice!philw
- From: philw@vice.ICO.TEK.COM (Philip W White)
- Newsgroups: comp.unix.questions
- Subject: Re: Dumb Question...
- Keywords: rm
- Message-ID: <11081@vice.ICO.TEK.COM>
- Date: 8 Jan 93 02:58:37 GMT
- Distribution: na
- Organization: Tektronix Inc., Beaverton, Or.
- Lines: 60
-
- adams@liszt.berkeley.edu (Adam L. Schwartz)
- wrote in <1993Jan7.184644.19735@pasteur.Berkeley.EDU>:
-
- :: In article <C0EsA1.3u2@ncifcrf.gov> digennar@fcs280s.ncifcrf.gov (Frank S. DiGennaro) writes:
- :: > This might seem a simple question, but here goes... does UNIX have an 'unerase'
- :: >command similar to DOS?
- :: >
- ::
- :: On our system, we have a set of commands which allow this action. The
- :: first command is aliased to 'rm'. When used, instead of erasing the
- :: file, it moves it to a separate directory.
-
-
- BUT in
-
- Subject: Unix - Frequently Asked Questions (3/7) [Frequent posting]
- of: 7 Jan 93 06:03:12 GMT
-
- we see:
-
- :: 3.6) How do I "undelete" a file?
- ::
- :: Someday, you are going to accidentally type something like
- :: "rm * .foo", and find you just deleted "*" instead of "*.foo".
- :: Consider it a rite of passage.
- :: [...]
- :: Your first reaction when you "rm" a file by mistake is why not
- :: make a shell alias or procedure which changes "rm" to move files
- :: into a trash bin rather than delete them? That way you can
- :: recover them if you make a mistake, and periodically clean out
- :: your trash bin. Two points: first, this is generally accepted
- :: as a *bad* idea. You will become dependent upon this behaviour
- :: of "rm", and you will find yourself someday on a normal system
- :: where "rm" is really "rm", and you will get yourself in trouble.
- :: [...]
- :: If you are still undaunted, then here is a possible simple
- :: answer. You can create yourself a "can" command which moves
- :: files into a trashcan directory. In csh(1) you can place the
- :: following commands in the ".login" file in your home directory:
- ::
- :: alias can 'mv \!* ~/.trashcan' # junk file(s) to trashcan
- :: alias mtcan 'rm -f ~/.trashcan/*' # irretrievably empty trash
- :: if ( ! -d ~/.trashcan ) mkdir ~/.trashcan # ensure trashcan exists
- :: [...]
- :: Ted Timar - tmatimar@empress.com
- :: Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
-
-
- I agree emphatically with the text I quoted from the FAQ above:
-
- DO NOT ALIAS rm! Use some other name! I use "del".
-
- My apoliogies for reposting a small part of the FAQ text - I am trying
- to show that "the net" has reached a "consensus" on this issue and
- that I share that opinion. You WILL someday find yourself on a new
- Unix machine or account without that alias installed.
-
- Phil White Tektronix, Beaverton, OR
- USENET: philip.w.white@tek.COM
- US Mail: Mail Stop 59-432, P.O. Box 500, Beaverton OR 97077-0001
-