압축 | 특징 | 확장자 | 옵션 | 해제 |
tar | 1. 압축률↓ 2. 압축효과(압축X) 3. 상대경로명 사용 (recommend) | .tar | tar -cvf [파일명] [대상] tar -tvf [파일명] [대상] tar -xvf [파일명] [대상] tar -rvf [파일명] [대상] | .tar -xvf |
compress | 압축률↓↓ 원본파일 삭제됨 | .Z | compress -cdv [파일명] uncompress -cv [파일명] | uncompress |
gzip | 압축률↓ 원본파일 삭제됨 | .gz | gzip -cdrv [파일명] gunzip -crv [파일명] | gunzip |
bzip2 | 압축률↑ 원본파일 삭제됨 | .bz | bzip2 -cdkv [파일명] bunzip2 -ckvz [파일명] | bunzip2 |
zip | 압축률↑ 원본파일 삭제되지 않음 | .zip | zip -rv [파일.zip] [파일명] unzip -lv [파일.zip] [파일명] | unzip |
① tar [옵션] [파일이름.tar] [묶을파일명]
- 압축하는 기능은 없지만 압축효과는 있음
- 상대경로명을 사용하는 것이 좋음.
[option]
c (create) | 여러개의 파일을 하나로 만들어 주는기능 |
v (verbose) | 작업수행과정을 화면으로 보여주는 기능 |
f (file) | 저장될 파일명 지정 |
t (table of contents) | 묶음을 풀기전에 미리 내용 확인하는 기능 |
r | tar파일에 새로운 파일을 추가해 넣는다. |
x (extract) | tar 파일 풀기 |
z | tar+gzip의미로 압축을 지원 |
j | tar+bzip2의미로 압축을 지원 |
** 파일 해제 시 해제할 경로명 입력 안하면 덮어쓸 수 있음.
① compress [-옵션] [압축할_파일명] / uncompress [-옵션] [파일명]
- 압축율 낮다.
- 확장자 : .Z
- compress [-cdv] [압축할_파일명] / uncompress [-cv] [파일명]
EX1) compress -c files.tar
EX2) compress -cv files.tar
EX3) uncompress -v files.tar.Z
② gzip [-옵션] [파일명] / gunzip [-옵션] [파일명]
- 압축율 낮다.
- 확장자 : .gz
- gzip [-cdrv] [파일명] / gunzip [-crv] [파일명]
EX1) gzip -c files.tar
EX2) gzip -cv include.tar
EX3) gunzip -v include.tar.gz
③ bzip2 [-옵션] [파일명] / bunzip2 [-옵션] [파일명]
- 압축율 좋다.
- 확장자 : .bz
- bzip2 -cdkv [파일명] / bunzip2 -ckvz [파일명]
- bunzip2 -c = bzip2 -dc = bzcat
EX1) bzip2 -c files.tar
EX2) bzip2 -cv include.tar
EX3) bunzip2 -v include.tar.bz
3. 파일과 디렉토리를 한꺼번에 압축하는 명령어
① zip [옵션] [zip파일] [파일명] / unzip [옵션] [zip파일] [-x 파일명]
- 압축률이 좋다.
- 확장자 : .zip
- 실제 상대 경로명으로 저장된다.
- zip -rv [zip파일] [파일명] / unzip -lv [zip파일] [파일명]
EX1) zip file1.zip files1 : files1을 file1.zip으로 압축
EX2) zip -rv etc.zip /etc
EX3) unzip -lv etc.zip
EX4) unzip -v etc.zip
② jar
EX) jar cvf /test/compress/include.jar include
4. 파일내용을 Console로 보여주는 명령어
① zcat
EX) zcat file.tar.Z = uncompress -c file.tar.Z = compress -dc file.tar.Z
② gzcat
EX) gzcat file.tar.gz = gunzip -c file.tar.gz = gzip -dc file.tar.gz
③ bzcat
EX) bzcat file.tar.bz2 = gunzip -c file.tar.bz2 = gzip -dc file.tar.bz2
5. 기타 Backup 명령어
① cpio
- copy in & out
- tar, zip, jar 등이 처리할 수 없는 특수한 파일도 백업가능(하드웨어 장치파일, pipe파일, socket파일 등 )
- Tape에 백업 시 여러개의 tape에 백업하는 기능 제공
- 백업 시 find 명령어와 함께 사용
EX) find include | cpio -ovO include.cpio
② dd
- 파일시스템을 인식하지 않고 512바이트 단위로 백업 (블록단위로)
- 동일한 디스크를 똑같이 복사 할때
- 부팅 디스켓을 만들때
- 기본 입출력을 표준 입출력으로 사용
- dd [-if=filename] [of=filename] [ibs=n] [obs=n] [bs=n] [skip=n] [seek=n] [count=n]
EX) dd if=/dev/dsk/c0t0d0s0 of=/dev/dsk/c0t3d0s0
③ volcopy
- vloume copy
- 파티션의 파일시스템을 인식해서 복사
- volcopy [-F fstype] [fsname] [src_dev] [src_vol] [dst_dev] [dst_vol]
** fsname : 복사하는 파티션의 마운트 포인트
④ mt
- magnetic tape
- 테이프 자체를 제어하는 명령어
- mt [-F tape] [command] [count]
** status, rewind, fsf, bsf, eom, offline 등
'os > Solaris' 카테고리의 다른 글
10. user관리 (0) | 2014.08.28 |
---|---|
9. vold (volume management) (0) | 2014.08.28 |
7. process 관리 (0) | 2014.08.28 |
6. 파일권한관리 (0) | 2014.08.28 |
5. 검색 (find, grep, egrep) (0) | 2014.08.28 |
댓글