Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

iSeries / AS400 FAQ : (Category) General : How can I recursively change the owner of objects in the IFS?

0
Posted

iSeries / AS400 FAQ : (Category) General : How can I recursively change the owner of objects in the IFS?

0

Q. I want to change the owner for all the objects in the IFS and recurse into each subdirectory and change the ownership there as well. What’s a good way to do that, since CHGOWN doesn’t recurse? A. This is easy to do in QSHELL. For example, to change everything in directory called /some/dir to be owned by klemscot: STRQSH find /some/dir -exec chown klemscot {} \; Or, maybe when one employee leaves and a new one starts you want to change ownership from one person to another: find . -user mike -exec chown klemscot {} \; (the . means it will work out of the current directory) In fact, you can have any QSHELL command be executed after the “-exec” keyword. The {} is replaced with the name of the file when the command is executed, and the \; tells the find command that it’s reached the end of the command string. So, if you wanted to remove write access to everything in a directory, you might do this: find /some/dir -exec chmod -w {} \; Or, of course, only take write access away from files w

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.