[Ilugc] difference between rm '??' and rm ??

  • From: ramanraj@xxxxxxxxxxxxxxx (Ramanraj K)
  • Date: Tue, 17 Feb 2004 04:39:03 +0530

nagendra wrote:

At 06:31 PM 2/16/2004 +0530, Ramanraj K wrote:

Sridhar R wrote:

How to delete file ??

rm '??'

rm ./??

Please note the difference between:
rm '??'     # metacharacters escaped with quotes
and
rm ??       # pattern matching with wild-cards

Suppose a directory has the files fu foo and ??
rm '??' will remove the file named ?? only
rm ?? will remove both ?? and fu
[Suraj already pointed out how DANGEROUS the latter is, but it is really 
useful to know the difference]

BTW, rm \?\? works as expected in GNU bash, version 2.04.0(1)-release


Other related posts: