2011-12-06 4 views

답변

2

당신이 리눅스에이 일을하고 있다는 가정 :

다른 파일로

동일 크기 : 다른 파일보다

$ find . -size `stat --printf '%s' $other_file`c 

큰 :

$ find . -size +`stat --printf '%s' $other_file`c 

작은 :

$ find . -size -`stat --printf '%s' $other_file`c 
0

find(1)에는 파일 atime, mtime 또는 ctime을 참조 파일과 비교할 때와 같이 직접 파일 크기 비교 도구가 없습니다.

당신이 그와 유사하다 할 수있는 일 find(1)를 호출하기 전에 참조 파일의 크기를 검색 할 수 있습니다 :

find . -type f -size -$(stat -c %s /etc/passwd)c -ls # smaller than /etc/passwd 
find . -type f -size +$(stat -c %s /etc/passwd)c -ls # larger than /etc/passwd 
find . -type f -size $(stat -c %s /etc/passwd)c -ls # same size as /etc/passwd 
관련 문제