Warning about rm (really the shell)

Jerry Peek jerryp at tektools.UUCP
Wed Jul 30 03:09:46 AEST 1986


[Moved from net.unix-wizards...]

In article <79 at wanginst.UUCP>, tupper at wanginst.UUCP (John Tupper) writes:
> Today I ran the following command:
> 	rm -r /student/tupper/.dead/.*
> The shell expanded my wild card to include /student/tupper/.dead/.
> and (this is the important part -->) /student/tupper/.dead/.. (that's
> "dot-dot")!

For just that reason, I've gotten in the habit of using
	.??*
instead of just
	.*
One problem:  .??* doesn't match things with names like .x -- but I
usually don't use names that short, anyhow.

To match all files and directories, try (with csh only):
	{*,.??*}
as in:
	rm -r /student/tupper/.dead/{*,.??*}

--Jerry Peek, Tektronix, Inc.
US Mail:    MS 74-222, P.O. Box 500, Beaverton, OR 97077
uucp:       {allegra,decvax,hplabs,ihnp4,ucbvax}!tektronix!tektools!jerryp
CS,ARPAnet: jerryp%tektools at tektronix.csnet
Phone:      +1 503 627-1603



More information about the Comp.unix mailing list