unpack 명령어 (AIX 5.3·6.1)

핵심 정리

  • pack으로 만든 파일.z를 풀어 .z를 뗀 이름으로 바꿉니다. unpack 파일.z 또는 .z 없이 unpack 파일.
  • root면 원래 모드·시각·소유자·그룹을, 아니면 모드와 시각만 유지하고 소유자·그룹은 실행한 사용자가 됩니다.
  • 종료 값은 풀지 못한 파일 수입니다. 같은 이름의 파일이 이미 있거나 pack 파일이 아니면 풀지 않습니다.
  • 링크가 있는 pack 파일을 풀면 새 파일은 다른 inode가 되어, 다른 링크 이름은 여전히 압축된 상태로 남습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (두 버전의 내용이 같음)
원문 IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5
파일 /usr/bin/unpack
관련 명령어 pack, pcat, compress

목적

파일을 풉니다.

영어 원문

Expands files.

구문

text
unpack File ...

설명

unpack 명령은 pack으로 만든 파일을 풉니다. 지정한 파일마다 File.z를 찾아, pack 파일이면 푼 것으로 바꿉니다. 새 파일 이름은 .z를 뗀 것입니다. root 권한이 있으면 새 파일은 원래 파일의 접근 모드, 접근·수정 시각, 소유자, 그룹을 갖고, 없으면 접근 모드와 시각은 유지하되 소유자와 그룹은 새로 정해집니다.

unpack은 .z로 끝나는 파일에만 동작합니다. 그래서 .z로 끝나지 않는 이름을 주면 접미사를 붙여 디렉터리에서 찾습니다.

종료 값은 풀지 못한 파일 수입니다. 다음 경우 풀 수 없습니다.

  • .z를 뺀 파일 이름이 253바이트를 넘음
  • 파일을 열 수 없음
  • pack 파일이 아님
  • 풀린 이름의 파일이 이미 있음
  • 풀린 파일을 만들 수 없음

참고: 푸는 파일에 링크가 있으면 표준 오류에 경고를 씁니다. 새 파일은 원래 pack 파일과 다른 inode를 가지며, 원래 inode에 링크된 다른 파일들은 그대로 남아 여전히 압축된 상태입니다.

영어 원문

The unpack command expands files created by the pack command. For each file specified, the unpack command searches for a file called File.z. If this file is a packed file, the unpack command replaces it by its expanded version. The unpack command names the new file name by removing the .z suffix from File. If the user has root authority, the new file has the same access modes, access and modification times, owner, and group as the original file. If the user does not have root authority, the file retains the same access modes, access time, and modification time, but acquires a new owner and group.

The unpack command operates only on files ending in .z. As a result, when you specify a file name that does not end in .z, the unpack command adds the suffix and searches the directory for a file name with that suffix.

The exit value is the number of files the unpack command was unable to unpack. A file cannot be unpacked if any of the following occurs:

  • The file name (exclusive of .z) has more than 253 bytes.

  • The file cannot be opened.

  • The file is not a packed file.

  • A file with the unpacked file name already exists.

  • The unpacked file cannot be created.

Note: The unpack command writes a warning to standard error if the file it is unpacking has links. The new unpacked file has a different i-node than the packed file from which it was created. However, any other files linked to the original i-node of the packed file still exist and are still packed.

종료 상태

값 뜻
0 성공
0보다 큼 오류
영어 원문

This command returns the following exit values:

  • 0 — The command ran successfully.
  • >0 — An error occurred.

예제

pack 파일 chap1.z, chap2.z를 풀어 chap1, chap2로 바꿉니다. 파일 이름에 .z를 붙여도 되고 빼도 됩니다.

bash
unpack chap1.z chap2
영어 원문

To unpack packed files: unpack chap1.z chap2

This expands the packed files chap1.z and chap2.z, and replaces them with files named chap1 and chap2. Note that you can give the unpack command file names either with or without the .z suffix.

파일

파일 설명
/usr/bin/unpack unpack 명령
영어 원문
  • /usr/bin/unpack — Contains the unpack command.

Related information:

  • cat command
  • compress command
  • pack command
  • Files command

리눅스(GNU)와 다른 점

pack·unpack(Huffman 부호, .z)은 아주 오래된 형식이라 리눅스 배포판에는 거의 없습니다. GNU gzip -d가 pack 형식(.z)도 풀 수 있으니 리눅스에서 열 때는 gunzip 파일.z를 써 봅니다.