[H-GEN] Help! Is there any advice on recovering deleted files?
Greg Black
gjb at gbch.net
Mon Aug 18 21:51:06 EDT 2003
On 2003-08-18, Robert Brockway wrote:
> On Tue, 19 Aug 2003, Nikolai Lusan wrote:
>
> > Lastly let me say if rm -f caused your problem it was becaus you passed
> > it a bad argument or no argument at all, I would recomend you read very
> > very carfully before pressing enter on an rm line and/or use the -i
> > option.
>
> Another good idea is to take advantage of the fact that expansion is done
> in the shell in unix (unlike in MS-Windows). As a result you can use ls
> to list the files that you think you want to delete with rm. The list
> generated will be the same with both commands. This is particularly
> useful when you want to pass a complicated expansion to rm.
Unless you want to use rm(1)'s "-r" option. Consider:
$ cd /tmp/example
$ mkdir -p a/b/c/d
$ ls *
b
$ rm *
rm: a: is a directory
$ ls -r *
b
$ rm -r *
$ ls
$ mkdir -p a/b/c/d
$ ls -R *
b
a/b:
c
a/b/c:
d
a/b/c/d:
$ rm -r *
$
The real truth is that there are invocations of rm(1) that will
have results that cannot be predicted by simple use of other
standard tools, although find(1) can be used to assist with the
impact of rm(1)'s "-r" option.
I once added a "-n" option to rm(1) that worked the same way as
the similarly named option in make(1); some of my customers said
it was helpful.
Cheers, Greg
--
Greg Black <gjb at gbch.net> <http://www.gbch.net/gjb.html>
GPG signed mail preferred; further information in headers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 249 bytes
Desc: not available
URL: <http://lists.humbug.org.au/pipermail/general/attachments/20030819/f5b3ecfb/attachment.sig>
More information about the General
mailing list