[Ilugc] cp command with retaining permission

  • From: rajasuperman@xxxxxxxxx (Raja Subramanian)
  • Date: Fri Nov 12 19:07:45 2010

On Fri, Nov 12, 2010 at 5:25 PM, steve <steve@xxxxxxxxxxxx> wrote:

find <pathname> -group <old group> -exec chown <newowner>:<newgroup> {} \;

If you have too many files, then invoking chown for every match will
be slow.  For large data sets, I combine xargs like this:
    find <opts>  -print0 | xargs -0 chown newowner:newgroup


Another neat usage for find is to recursively list file details:
    find -ls

Filter this output with awk/grep and can quickly select interesting files,
import this into a spread sheet as delimited text, etc.

- Raja

Other related posts: