Hi all, $ umask 0002 $ mkdir test $ ls -ld test drwxrwxr-x 2 user user 4096 Jun 23 19:04 test/ $ls -ld content drwxr-xr-x 2 user user 4096 Jun 23 19:29 content $ cp -r content test/ $ls -ld test/content drwxr-xr-x 2 user user 4096 Jun 23 19:29 content My question is, how can I make content directory permission mode to 775 if I do cp inside the test directory? Thanks. Regards, James -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20100623/92338640/attachment.html>
Andreas Reschke
2010-Jun-23 11:37 UTC
[CentOS] Antwort: umask not functioning with cp command
centos-bounces at centos.org wrote on 23.06.2010 13:31:56:> James Corteciano <james at linux-source.org> > Gesendet von: centos-bounces at centos.org > > 23.06.2010 13:32 > > Bitte antworten an > CentOS mailing list <centos at centos.org> > > An > > CentOS mailing list <centos at centos.org> > > Kopie > > Thema > > [CentOS] umask not functioning with cp command > > Hi all, > > $ umask 0002 > $ mkdir test > $ ls -ld test > drwxrwxr-x 2 user user 4096 Jun 23 19:04 test/ > > $ls -ld content > drwxr-xr-x 2 user user 4096 Jun 23 19:29 content > > $ cp -r content test/ > $ls -ld test/content > drwxr-xr-x 2 user user 4096 Jun 23 19:29 content > > My question is, how can I make content directory permission mode to > 775 if I do cp inside the test directory? > > Thanks. > > Regards, > James > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centosHi James, in this case, you must copy with cp -p (or better -a same -dpR) to preserve all atributes. man cp Gru? Andreas Reschke ________________________________________________________________ BG-IM173 Unix/Linux-Administration Behr GmbH & Co. KG -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20100623/801ba723/attachment.html>
From: Andreas Reschke <Andreas.Reschke at behrgroup.com>>> James Corteciano <james at linux-source.org> >> $ umask 0002 >> $ mkdir test >> $ ls -ld test >> drwxrwxr-x 2 user user 4096 Jun 23 19:04 test/ >> $ls -ld content >> drwxr-xr-x 2 user user 4096 Jun 23 19:29 content >> $ cp -r content test/ >> $ls -ld test/content >> drwxr-xr-x 2 user user 4096 Jun 23 19:29 content >> My question is, how can I make content directory permission mode to >> 775 if I do cp inside the test directory? > in this case, you must copy with cp -p (or better > -a same -dpR) to preserve all atributes. > man cp-p preserves the source permissions... In this case, he wants the target directory to inherit its permissions from its parent... And I think Unix doesn't support the idea of inherited permissions (except for the sgid bit). Is running a simple 'chmod 775 test/content', after the cp, not an option...? JD