 |
|
Preventing accidental file
deletion
Oracle Tips by Burleson Consulting |
A little trick that some Linux users like to implement to prevent
accidental file deletion is via the use of an alias. By placing the
following command alias in your .bash_profile file, you will be
prompted to confirm each file before it is deleted; otherwise
Linux, unlike Microsoft Windows, will delete whatever files
match your filename criteria.
Directory:~
$ alias rm='rm -i' create
command alias
Directory:~
$ touch touch1.fil touch2.fil touch3.fil create
some files
Directory:~
$ rm touch* delete
the files we created
rm: remove regular empty file `touch1.fil'? y
rm: remove regular empty file `touch2.fil'? y
rm: remove regular empty file `touch3.fil'? y
Directory:~
$
The above book excerpt is from:
Easy Linux
Commands
Working Examples of Linux Command Syntax
ISBN:
0-9759135-0-6
Terry Clark