같은 경로를 반복하지 않고 한 줄에 쓰는 방법은 무엇입니까?
rsync -a [email protected]:/folder/remote/*.txt .
rsync -a [email protected]:/folder/remote/*.jpg .
다음과 같이 작성합니다.
rsync -a [email protected]:/folder/remote/*.{txt,jpg} .
rsync -a --include='*.txt' --include='*.jpg' --exclude='*' [email protected]:/folder/remote/ .
(/
의 마지막 /folder/remote/
와 포함 규칙 뒤에 --exclude='*'
의 위치가 중요합니다.) 중괄호 확장을 지원하는 쉘 (예 : bash, ksh, zsh) :
rsync -a --include='*.'{txt,jpg} --exclude='*' [email protected]:/folder/remote/ .
하위 디렉터리에있는 파일도 복사하려면 --include='*/' --Prune-empty-dirs
를 추가합니다.