IT

0099. 두디렉토리 트리내의 파일명들을 비교하기

띠앗머리 2015. 7. 6. 12:48

%cd directory1

%find . -type f -print | sort > /tmp/dir1

%cd directory2

%find . -type f -print | sort > /tmp/dir2

%comm -3 /tmp/dir[12]

%rm /tmp/dir[12]


comm 명령어는 열을 보여줄것이다.

왼쪽열(directory1)  오른쪽열(directory2)

에만 있는 파일     에만 있는 파일


%rsh host \

`cd directory2 ; find . -type f -print | sort | comm -3 /tmp/dir1 -`