Use 'mv' command to move files except those in a specific directory In Linux, I know the command mv !(folder1|folder2) folder1 if I want to move all files in current folder, excepted folder1 and folder2, and move they in folder1. But these commend, doesn't work in mac terminal! 

Where is the equivalent command in mac?
Looks like the version of bash on recent versions of macOS is a bit older than you'll find on some new Linux distros. I see version 3.2.57 on macOS High Sierra and Mojave and version 4.2.46 on RedHat Enterprise Linux 7.

Here's some syntax you can use to exclude the directories, as you've specified:

# move everything but dir1 &amp; dir2 into dir1
mv *[^dir1dir2]* dir1


And, the nice thing is, the syntax above ought to work in bash on both macOS and Linux.