copy without some folders

Copy a folder but leave out some of what is inside, like node_modules or .git.

  • files

Steps

  1. rsync -av --exclude='node_modules' src/ dest/

    copy src into dest without node_modules

  2. rsync -av --exclude={'.git','*.log'} src/ dest/

    without several things

  3. rsync -avn --exclude='node_modules' src/ dest/

    only show what would be copied (-n)

Commands used

  • rsync
  • cp

Each has a page in lore: lore rsync opens it.