You can't have rm
do something that it doesn't have the capability of doing. On the other hand srm
was designed expressly for this purpose. So, how do you get rm
to do something that srm
does out of the box?
Make an Alias
If you want to "use" (the command; not the actual program) rm
to do a single pass, use an alias. To do this, you will need to have srm
installed on your system (available in MacPorts).
$ alias rm="srm -s"
Now, anytime you issue the command rm
it will actually be calling srm
with the -s
flag for "single pass overwrite".
Usage example: Suppose you have a directory called foo
with a number of files that you want to delete. Issue the command
$ rm -rf foo
and what will actually be executed is:
$ srm -s -rf foo
Make the Alias permanant
Edit your ~/.bash_profile
and add the alias entry. Restart your bash session and the "one pass rm
command" will now be available.
srm
? This is what's it's designed for.