In all versions of bash (and every other shell I've ever seen), * ignores
dot files by default. You would have to do .* if you want such a command to
expand to include dot files. Thus 'rm NNN/*' will never recurse into . or
.. . Nor will 'ls NNN/*' for that matter. Otherwise the * operator would be
pretty useless, as many instances of it would end up covering the entire
file system and/or recursing infinitely between .. and . . 'rm NNN/*' is
safe and a fairly common operation assuming you want to delete all non-dot
files in a folder.

That said, even doing 'rm * .*' is "safe" on most every system as rm
ignores directories by default, including . and .. , unless you pass the -r
flag. The -r flag is smart enough to ignore . and .. as well. The only way
I know of to nuke teh entire file system is to do an 'rm -r * /'. If in
doubt, run rm in interactive mode ('-i') to prompt you for confirmation
before each remove operation.


On Wed, May 7, 2014 at 5:40 PM, Cowboy <[email protected]> wrote:

> On Wednesday 07 May 2014 04:13:31 pm Rob Landry wrote:
> > rm /var/snd/*
>
>  BE CAREFUL with that !!!
>
>  Remember * would include both . and .. so unless your particular
>  system explicitly prohibits recursive delete, you could wipe the drive
> that way.
>
> --
> Cowboy
>
> http://cowboy.cwf1.com
>
> A citizen of America will cross the ocean to fight for democracy, but
> won't cross the street to vote in a national election.
>                 -- Bill Vaughan
> _______________________________________________
> Rivendell-dev mailing list
> [email protected]
> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to