To delete all folders in the current directory with pattern matching

后端 未结 3 1012
清歌不尽
清歌不尽 2021-01-15 21:07

I need to delete all the folders in current directory that starts with say \"foo\" followed by date
for example we have

  1. foo20120620
  2. foo2
3条回答
  •  失恋的感觉
    2021-01-15 21:49

    I know this is old, but I thought it would be worth mentioning that the FOR command creates parameter variables which are identified with a letter rather than a number (e.g. %%G), so, in order to avoid confusion between parameters and pathname format letters, avoid using the letters (a, d, f, n, p, s, t, x, z) as FOR parameters or just choose a FOR parameter letter that is UPPER case.

    Format letters are case sensitive, so using a capital letter is also a good way to avoid conflicts, eg. %%A rather than %%a.

    Reference

提交回复
热议问题