23.7 Safer File Deletion in Some DirectoriesUsing noclobber ( 13.6 ) and read-only files only protects you from a few occasional mistakes. A potentially catastrophic error is typing:
% instead of:
% In the blink of an eye, all of your files would be gone. A simple, yet effective, preventive measure is to create a file called -i in the particular directory in which you want extra protection:
In the above case, the
The -i file also won't save you from errors like:
% [Two comments about Bruce's classic and handy tip: first, if lots of users each make a -i file in each of their zillions of subdirectories, that could waste a lot of disk inodes ( 1.22 ) . It might be better to make one -i file in your home directory and hard link ( 24.4 ) the rest to it, like:
Second, to save disk blocks, make sure the -i file is zero-length - use the touch command, not vi or some other command that puts characters in the file. -JP ] - |
|