Exclude Files or Directories When Performing a Chown

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives the some examples of how you can change ownership of files and directories while excluding specific files and directories. This can be useful if there are symlinks or mounts in the directory you don't want to touch or spend the time waiting for.


Steps

ls | grep -v itemnametoskip | xargs -n1 sudo chown -R apache.apache


Related Articles