chgrp -ROf course, you might not want to change the group of just one file or directory. If you want to change the groups of several files in a directory, you can use a wildcard. If you want to change the contents of a directory and everything below it, use the -R (or --recursive) option. $ pwd /home/scott/pictures/libby $ ls -F by_pool/ libby_arrowrock.jpg libby.jpg on_floor/ $ ls -lF * -rw-r--r-- 1 scott scott ... libby_arrowrock.jpg -rw-r--r-- 1 scott scott ... libby.jpg by_pool/: -rw-r--r-- 1 scott scott ... libby_by_pool_02.jpg drwxr-xr-x 2 scott scott ... lieberman_pool on_floor/: -rw-r--r-- 1 scott scott ... libby_on_floor_01.jpg -rw-r--r-- 1 scott scott ... libby_on_floor_02.jpg $ chgrp -R family */* $ ls -l * -rw-r--r-- 1 scott family ... libby_arrowrock.jpg -rw-r--r-- 1 scott family ... libby.jpg by_pool: -rw-r--r-- 1 scott family ... libby_by_pool_02.jpg drwxr-xr-x 2 scott family ... lieberman_pool on_floor: -rw-r--r-- 1 scott family ... libby_on_floor_01.jpg -rw-r--r-- 1 scott family ... libby_on_floor_02.jpg Caution If you used chgrp -R family *, you wouldn't change any of the dot files in the /home/scott/pictures/libby directory. However, chgrp -R family .* should not be used. It changes all the dot files in the current directory, but .* also matches .., so all the files in the parent directory are also changed, which is probably not what you want! |