From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e4d3a479a9953852 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-11-11 09:15:51 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!godot.cc.duq.edu!news.duke.edu!eff!news.kei.com!ddsw1!news.cic.net!locust.cic.net!pauls From: pauls@locust.cic.net (Paul Southworth) Newsgroups: comp.unix.osf.osf1 Subject: Re: chown-oddities? Date: 11 Nov 1994 15:34:38 GMT Organization: CICNet, Inc. Message-ID: <3a02uf$grq@spruce.cic.net> References: <39sn7h$gjl@hermes.uni-konstanz.de> NNTP-Posting-Host: locust.cic.net In article <39sn7h$gjl@hermes.uni-konstanz.de>, Eberhard Heuser-Hofmann wrote: >I'm not sure if it's a feature of chown or a bug of OSF/1 V3.0: Welcome to unix! "chown" is working just fine and OSF/1's chown is not buggy as far as I know. comp.unix.shell and comp.unix.questions are good places to ask these types of questions -- your question is not specific to OSF/1 at all. >chown -R "newowner" * > >modifies the ownership of all files to "newowner" exept of all .xxx file , i.e. .login. > >But: > >chown -R "newowner" .* > >runs through all files beginning from /rooted-dir! Yep, because that's what you just told it to do. "." is the current directory, and ".." is the parent directory, so ".*" matches all dot-files in the current directory, plus all of the parent directory. There are fairly easy ways around this. First, this will decend through all directories in the current directory (including the current directory itself) and chown all files (not directories) that match .* find . -type f -name ".*" -exec chown newowner {} \; Or this can be used to avoid matching "..". It will also fail to match any files starting with "." that have names of only two characters: chown -R newowner .??* Of course, if you really want to just chown all of the contents of a directory, just do: ( cd .. ; chown -R newowner directoryname ) >Remark: why is there no verbose-option in chown to see what happens? Because you didn't write it yet, and nobody else saw the need. You can get sources to chown on prep.ai.mit.edu:/pub/gnu/fileutils-3.12.tar.gz. Then you can hack in whatever additional output you think it should have. -- Paul Southworth CICNet Systems Support pauls@cic.net