폴더 및 파일 권한 설정 질문입니다

우분투 12.04 서버 버전을 사용하고 있습니다.

/test/usr/a폴더
/b폴더
/c폴더

/z폴더

현재 구조의 디렉토리가 있습니다.

여기에서 test 아래에 모든 폴더들의 권한을 707로 모든 파일의 권한은 644로 일괄 변경하고 싶습니다…

어떤 옵션을 줘서 chmod 명령을 사용하면 되나요?

참고 http://movabletripe.com/archive/recursi … ries-only/

http://www.zarzax.com/blog/2009/5/6/chm ... -find.html

test 디렉토리로 들어가서 아래의 명령을 수행하면 될 듯합니다.

[code:2dze394o]

-type d 는 디렉토리를 의미

find -name ‘*’ -exec chmod 707 {} ;

-type f 는 파일을 의미, .은 현재 디렉토리

find . -type f -exec chmod 644 {} ;[/code:2dze394o]

[quote="sakakisan":33dvn24s]우분투 12.04 서버 버전을 사용하고 있습니다.

/test/usr/a폴더
/b폴더
/c폴더

/z폴더

현재 구조의 디렉토리가 있습니다.

여기에서 test 아래에 모든 폴더들의 권한을 707로 모든 파일의 권한은 644로 일괄 변경하고 싶습니다…

어떤 옵션을 줘서 chmod 명령을 사용하면 되나요?[/quote:33dvn24s]

#test디렉토리 포함
find /test -type d -exec chmod 707 "{}" ; -o -type f -exec chmod 644 "{}" ;
#test 디렉토리 미포함
find /test -mindepth 1 -type d -exec chmod 707 "{}" ; -o -type f -exec chmod 644 "{}" ;
#test 디렉토리와 파일 미포함
find /test -mindepth 2 -type d -exec chmod 707 "{}" ; -o -type f -exec chmod 644 "{}" ;