# find /home/daresore -exec chown dokosoko {} \; \
-exec chgrp users {} \;
有るディレクトリ のファイルの 所有者と グループの変更
ほたら 試してみましょう
# ls -l htdocs/
total 36
drwxr-xr-x 2 fdopstm users 4096 Nov 5 18:44 002_css/
drwxr-xr-x 3 fdopstm users 4096 Nov 21 2006 005_img/
drwxr-xr-x 19 fdopstm users 4096 Nov 12 09:36 1001_base/
drwxr-xr-x 8 fdopstm users 4096 Nov 9 10:42 8000_secret/
drwxr-xr-x 5 fdopstm users 4096 Oct 25 20:46 9001_users/
-rw-r--r-- 1 fdopstm users 6585 Nov 8 11:29 index.html
drwxr-xr-x 6 fdopstm users 4096 Nov 8 11:25 u_data/
drwxr-xr-x 2 fdopstm users 4096 Jun 21 2005 v_org_data/
# find /var/data/www/apache2/htdocs/ -exec chown apache {} \; \
> -exec chgrp apache {} \;
# ls -l /var/data/www/apache2/htdocs/
total 36
drwxr-xr-x 2 apache apache 4096 Nov 5 18:44 002_css/
drwxr-xr-x 3 apache apache 4096 Nov 21 2006 005_img/
drwxr-xr-x 19 apache apache 4096 Nov 12 09:36 1001_base/
drwxr-xr-x 8 apache apache 4096 Nov 9 10:42 8000_secret/
drwxr-xr-x 5 apache apache 4096 Oct 25 20:46 9001_users/
-rw-r--r-- 1 apache apache 6585 Nov 8 11:29 index.html
drwxr-xr-x 6 apache apache 4096 Nov 8 11:25 u_data/
drwxr-xr-x 2 apache apache 4096 Jun 21 2005 v_org_data/
ファイルを集める
# find /where -name '*.c' -exec mv {} /where/here \;
では やってみよう
# cd /home/
# mkdir where
# mkdir where/here
# cd where/
# touch abc.c
# touch ffg.c
# touch ssshk.c
# ls
abc.c ffg.c here/ ssshk.c
# cd here/
# touch here-abc.c
# touch here-ddd.c
# ls
here-abc.c here-ddd.c
# cd
# find /home/where -name '*.c' -exec mv {} /home/where/here \;
mv: `/home/where/here/here-abc.c' and `/home/where/here/here-abc.c' are the same file
mv: `/home/where/here/here-ddd.c' and `/home/where/here/here-ddd.c' are the same file
# ls /home/where/
here/
# ls /home/where/here/
abc.c ffg.c here-abc.c here-ddd.c ssshk.c
へい へい まだまだ続く
にゃんたろう 拝!
2007年11月26日 (月) 21:11:42 JST 作成