LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   help req in chown command (https://www.linuxquestions.org/questions/solaris-opensolaris-20/help-req-in-chown-command-466202/)

vishnu 07-21-2006 06:36 AM

help req in chown command
 
hi friends
I want t change the ownership of all files owned by a user harry on a folder /access to another user abhijeet. But the folder contains files owned by many other users also which I dont want to disturb..
Can any one help me with the chown command..

Now I am changing the ownership of files one by one using the command "chown abhijeet /access/stage12*

regards
VishnuPrasad Chaurasia

spirit receiver 07-21-2006 07:05 AM

The find command should do the trick. Note that it will also examine subdirectories of /access, use find's -maxdepth switch to prevent this.
Code:

find /access -type f -user harry -exec chown abhijeet '{}' \;


All times are GMT -5. The time now is 09:48 PM.