How do you exclude a folder when performing file operations i.e. cp etc.
I would currently use the wild card * to apply file operation to all, but I need to exclude one single folder.
The command I'm actually wanting to use is
chown to change the owner of all the files in a directory but I need to exclude one sub directory.
If you're using bash and enable extglob via
shopt -s extglob then you can use
!(<pattern>) to exclude the given pattern.
find dir_to_start -name dir_to_exclude -prune -o -print0 | xargs -0 chown owner find dir_to_start -not -name "file_to_exclude" -print0 | xargs -0 chown owner