I'm trying to copy all of the files/directories inside a folder but would like to exclude one folder as I want all the other file to be inside that folder. To better demonstrate below is the folder structure
- VideosFolder
L File1
L File2
L File3
L TutorialFolder
Now I want File1 File2 File3 to be moved to TutorialFolder like so
- VideosFolder
L TutorialFolder
L File1
L File2
L File3
I tried this command
mv ~/Desktop/VideosFolder/!(TutorialFolder) TutorialFolder
But I get this error
mv: cannot stat '/home/user/Desktop/VideosFolder/!(TutorialFolder)': No such file or directory
I checked if the shopt extglob is enabled and it is indeed enabled. So I'm not sure how to go about this.
bashand that theextglobshell option is set? I can only reproduce the error if I quote the destination path (meaning the glob won't expand). Assuming you are located in~/Desktop/VideosFolder, and that you have set theextglobshell option withshopt -s extglobinbash, than your command will work.