zip
명령어는 리눅스 및 유닉스 계열의 운영 체제에서 사용되는 압축 유틸리티입니다. zip
명령어를 사용하여 파일 및 디렉터리를 압축하고, 압축 파일을 생성하거나 압축을 해제할 수 있습니다. 아래는 zip
명령어의 주요 사용법에 대한 설명입니다:
파일 및 디렉터리 압축:
zip archive.zip file1 file2 directory
archive.zip
: 생성할 압축 파일의 이름file1 file2 directory
: 압축할 파일 및 디렉터리디렉터리 전체 압축:
zip -r archive.zip directory
-r
: 디렉터리 전체를 재귀적으로 압축압축 해제:
unzip archive.zip
압축 해제하여 특정 디렉터리에 저장:
unzip archive.zip -d /path/to/destination
-d
: 압축 해제할 디렉터리 지정압축 파일 내용 확인:
unzip -l archive.zip
암호로 보호된 압축 파일 생성:
zip -e archive.zip file1 file2
-e
: 암호로 보호된 압축 파일 생성압축 파일에 파일 추가:
zip archive.zip newfile
암호로 보호된 압축 파일 해제:
unzip -P password archive.zip
-P
: 암호 지정특정 파일 제외하고 압축:
zip archive.zip file1 file2 -x file3
-x
: 특정 파일 제외압축 파일을 지정한 디렉터리에 풀기:
unzip archive.zip -d /path/to/destination
zip
명령어는 다양한 옵션을 제공하여 유연한 압축 및 해제 작업이 가능합니다. 압축 파일의 생성, 추가, 해제, 암호 설정 등 다양한 작업을 지원하며, 특히 파일을 압축하고 전송 또는 보관하는 데에 유용하게 사용됩니다.