I'm trying to move all files from one folder to another, except some specific folders.
I tried this to move all files except the .git
, assets
or build
folders:
find .. ! -regex '\(.git\|assets\|build\)' | xargs mv -t ../build
What I except this command to do:
- Find all files/folders in parent folder that are not .git, assets or build.
- Move those files/folders to ../build
The folder structure is like this:
.
├── application
├── assets
├── build
├── download_files
├── images
├── mybb
├── system
└── tools
My working directory is the tools folder.
If I execute find .. ! -regex '\(.git\|assets\|build\)'
it still shows .git
, assets
and build.
What's wrong with my command?