com zsh
:
setopt extendedglob # best in ~/.zshrc
mv A/^(file|directory)(|2)(D) B/
(os arquivos (D)
para incluir ponto (ocultos)).
com bash
:
shopt -s extglob dotglob failglob
mv A/!(@(file|directory)?(2)) B/
com ksh93
(FIGNORE='@(.|..|@(file|directory)?(2))'; mv A/* B)