Search code examples
linuxmv

mv all files except their file name ends with .zip


I'm looking for a Linux command to move files from a directory to another, but only if their file name doesn't end with .zip.

Is their a command like: mv ~/Folder1/!*.zip ~/Folder2/?


Solution

  • Try this:

    mv $(ls ~/Folder1/ |grep -v "zip$"  ) ~/Folder2/