find는 기본적으로 하위 디렉토리를 뒤지도록 되어있기 때문에
강제로 현재 디렉토리만 검색을 하기 위해서는 옵션을 해주어야 한다.
아쉽게도 non-recursive 이런 옵션은 없고
-maxdepth 숫자
라는 옵션이 존재한다.
예를 들어 현재 디렉토리에서 크기가 0인 파일을 찾기 위해서는
$ find ./ -maxdepth 1 -size 0c
이라고 하면된다.
[링크 : http://www.unix.com/unix-dummies-questions-answers/423-using-find-command-only-current-directory.html]
            
                    
                    
강제로 현재 디렉토리만 검색을 하기 위해서는 옵션을 해주어야 한다.
아쉽게도 non-recursive 이런 옵션은 없고
-maxdepth 숫자
라는 옵션이 존재한다.
예를 들어 현재 디렉토리에서 크기가 0인 파일을 찾기 위해서는
$ find ./ -maxdepth 1 -size 0c
이라고 하면된다.
| find: warning: you have specified the -maxdepth option after a non-option argument -size, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments. maxdepth는 옵션이고 size는 옵션이 아니므로 순서를 반대로 하면 경고를 발생시킨다. | 
| -maxdepth levels Descend at most levels (a non-negative integer) levels of directories below the command line arguments. '-maxdepth 0' means only apply the tests and actions to the command line arguments. [링크 : http://linux.die.net/man/1/find] | 
[링크 : http://www.unix.com/unix-dummies-questions-answers/423-using-find-command-only-current-directory.html]
'Linux' 카테고리의 다른 글
| bash 환경설정 - 모든 유저를 한번에 설정하기 (0) | 2010.03.04 | 
|---|---|
| bash의 alias 제약사항/제한사항 (2) | 2010.03.02 | 
| bash 쉘 내장 명령어 history 사용하기 (2) | 2010.02.26 | 
| diff의 -u 옵션 출력 내용 읽기 how read diff unified format? (0) | 2010.02.23 | 
| configure 관련 문서 모음 (0) | 2010.02.23 | 






