home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15306 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.8 KB

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