uncompress 명령어 (AIX 5.3·6.1)

핵심 정리

  • compress로 만든 파일.Z를 풀어 .Z를 뗀 이름의 원래 파일로 바꿉니다. .Z 파일은 지워집니다.
  • uncompress 파일.Z(또는 .Z 없이 uncompress 파일), uncompress -c 파일.Z > 파일(원본을 두고 표준 출력으로), -f(묻지 않고 덮어쓰기).
  • root면 원래 소유자·그룹·모드·수정 시각을, 아니면 모드와 수정 시각만 유지하고 소유자·그룹은 실행한 사용자가 됩니다.
  • compress -n으로 만든 파일은 uncompress -n으로 풀어야 합니다. 내용만 보려면 zcat이 편합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (두 버전의 내용이 같음)
원문 IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5
파일 /usr/bin/uncompress
관련 명령어 compress, zcat, dmpuncompress, pack, gunzip

목적

압축한 파일을 되살립니다.

영어 원문

Restores compressed files.

구문

text
uncompress [ -c ] [ -F ] [ -f ] [ -n ] [ -q ] [ -V ] [ File ... ]

설명

uncompress 명령은 compress로 압축한 원래 파일을 되살립니다. File 매개변수로 준 압축 파일은 지우고 풀린 사본으로 바꿉니다. 풀린 파일의 이름은 압축 파일 이름에서 .Z를 뗀 것입니다. root 권한이 있으면 원래 파일의 소유자, 그룹, 모드, 수정 시각을 유지하고, 없으면 모드와 수정 시각은 유지하되 소유자와 그룹은 새로 정해집니다. 파일을 주지 않으면 표준 입력을 풀어 표준 출력에 씁니다.

영어 원문

The uncompress command restores original files that were compressed by the compress command. Each compressed file specified by the File parameter is removed and replaced by an expanded copy. The expanded file has the same name as the compressed version, but without the .Z extension. If the user has root authority, the expanded file retains the same owner, group, modes, and modification time as the original file. If the user does not have root authority, the file retains the same modes and modification time, but acquires a new owner and group. If no files are specified, standard input is expanded to standard output.

플래그

플래그 설명
-c 표준 출력에 씁니다. 파일은 바꾸지 않습니다.
-f, -F 강제로 풉니다(둘은 같음). 파일이 이미 있으면 묻지 않고 덮어씁니다.
-n 압축 파일에 헤더가 없는 것으로 봅니다. compress -n으로 만든 파일이면 이것을 써야 풀립니다.
-q -v의 압축 통계를 보여 주지 않습니다.
-V 현재 버전과 컴파일 옵션을 표준 오류에 씁니다.
영어 원문
  • -c — Write to standard output. No files are changed.
  • -f or -F — Forces expansion. The -f and -F flags are interchangeable. Overwrites the file if it already exists. The system does not prompt the user that an existing file will be overwritten. File size may not actually shrink.
  • -n — Omits the compressed file header from the compressed file. Note: Use this option if the file was compressed using the -n flag. Otherwise, uncompressing the file will not work.
  • -q — Suppresses the display of compression statistics generated by the -v flag. If several -v and -q flags are on the same command line, the last one specified controls the display of the statistics.
  • -V — Writes the current version and compile options to standard error.

매개변수

매개변수 설명
File ... 되살릴 압축 파일.
영어 원문
  • File ... — Specifies the compressed files to restore.

Return Values

다음 경우 오류로 보고 1로 끝나며, 오류가 없으면 0입니다.

  • 입력 파일이 compress로 만든 것이 아닙니다.
  • 입력 파일을 읽을 수 없거나 출력 파일을 쓸 수 없습니다.
영어 원문

The uncompress command detects an error and exit with a status of 1 if any of the following events occur:

  • The input file was not produced by the compress command.

  • An input file cannot be read or an output file cannot be written.

If no error occurs, the exit status is 0.

종료 상태

값 뜻
0 성공
0보다 큼 오류
영어 원문
  • 0 — Successful completion.
  • >0 — An error occurred.

예제

foo.Z를 풉니다. foo.Z는 풀려서 foo로 바뀝니다.

bash
uncompress foo.Z

자주 쓰는 형태:

bash
uncompress -c app.tar.Z | tar -xvf -     # 원본 .Z를 두고 바로 풀기
uncompress *.Z                           # 여러 파일
영어 원문

To uncompress the foo.Z file, enter: uncompress foo.Z

The foo.Z file is uncompressed and renamed foo.

Related information:

  • compress command
  • dmpuncompress command
  • pack command
  • zcat command
  • Commands overview

리눅스(GNU)와 다른 점

리눅스에서도 compress·uncompress(ncompress 패키지)를 쓸 수 있지만 거의 쓰이지 않고 gzip·gunzip·zcat(또는 bzip2, xz, zstd)을 씁니다. GNU gzip -d와 zcat은 .Z 파일도 풀 수 있어 AIX에서 만든 .Z를 리눅스에서 열 때 편합니다. AIX에도 AIX Toolbox의 gzip이 흔히 설치되어 있습니다.