在 Un*x 中有著几个被广泛使用於保存或压缩档案. tar 是一个保存档案的工具. 它有 点类似 PKZIP 但并不会作压缩的工作 -- 它只是将许多档案包装成一个而已: $ tar -cvf <archive_name.tar> <file> [file...]
把 tar file 解开, 要用以下的命令: $ tar -XPvf <archive_name.tar> [file...] 假如欲检视 tar file 中的档案列表, $ tar -tf <archive_name.tar> less 用 compress 或是 gzip 可以压缩档案. 压缩後档案就无法再使用除非解开来: $ compress <file> or: $ gzip <file> 这样建立出来的压缩档会以 .Z (compress) 或 .gz (gzip) 作为延伸档名. 这些档案 无法再被 compress 或 gzip 再压缩. 想将档案解压缩的话, 请用 $ compress -d <file> or $ gzip -d <file> 请参阅 Man pages. 其它像是 arj ,zip 或是 unzip (PK??ZIP 相容) 的工具在 Linux 下一样找得到. 在 Un*x 的世界里, .tar.gz 或 .tgz 的档案就像 DOS 下的 .ZIP 一般普遍. 以下这个命令可以浏览 .tar.gz 档案中的档案列表: $ gzip -dc <file.tar.gz> tar tf - less
|