On Fri, Sep 14, 2001 at 04:32:42AM +0100, Frank Shute wrote:
On Thu, Sep 13, 2001 at 09:13:48PM +0100, Matt Johnson wrote:
Ok, why when I type
cp /home/trial/USER.MAN /home/*/
does it reply:
omitting /home/trial2 omitting /home/trial3
errr... I don't know.
I want to copy the files to all directories under home.
Try:
# find /home -type d -maxdepth 1 -regex '/home/.*' -exec cp /home/trial/USER.MAN {}/ \;
Sorry, misread the question & thought you were just copying a single file rather than a dir. cp -R is the way to go as Derek suggests. You can still use find though (new improved version coming up!): # find /home -type d -mindepth 1 -maxdepth 1 -regex '/home/.*' \ -path '/home/trial' -prune -o -print -exec cp -R /home/trial/USER.MAN {} \; I think... If you use: cp -R /home/trial/USER.MAN /home/*/ then you might have problems when it tries to copy on itself as the glob will pick up /home/trial BTW, having a guess that USER.MAN might contain documentation for users, then it might be best to make a dir that's readable but not writable by all and stick the stuff in there - possibly under /usr/doc -- Frank *-*-*-*-*-*-*-*-*-*-* Boroughbridge. Tel: 01423 323019 --------- PGP keyID: 0xC0B341A3 *-*-*-*-*-*-*-*-*-*-* http://www.esperance-linux.co.uk/