Linux의 텍스트 파일에 나열된 거대한 zip 파일에서 일부 파일을 추출합니다.

Linux의 텍스트 파일에 나열된 거대한 zip 파일에서 일부 파일을 추출합니다.

.txt대용량 .zip파일에서 파일에 나열된 특정 파일만 추출 해야 합니다 .

나는 시도했다:

cat /HGC/list.txt | while read file ; 
do 
gunzip all_human_gene-specific_connectomes_122015.zip 
find . -name "$file" -exec cp{}  /HGC \; 
done

답변1

다음과 같이 파일의 하위 집합을 추출할 수 있습니다.

cat files.txt|xargs unzip archive.zip

어디파일.txt- 추출할 파일 목록입니다(와일드카드도 포함될 수 있습니다. 참조 man unzip).

파일 이름에 공백이 포함된 것으로 알려진 경우 다음과 같이 명령을 수정하십시오.

cat files.txt|xargs -d '\n' unzip archive.zip

관련 정보