linux_wiki:archive_compress_unpack_and_uncompress_files_using_tar_star_gzip_and_bzip2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux_wiki:archive_compress_unpack_and_uncompress_files_using_tar_star_gzip_and_bzip2 [2016/02/28 22:54]
billdozor created
linux_wiki:archive_compress_unpack_and_uncompress_files_using_tar_star_gzip_and_bzip2 [2019/05/25 23:50] (current)
Line 3: Line 3:
 **General Information** **General Information**
  
-About this page/how-to/script+You can do most all with tar, but it doesn't matter which tool you use to get the job done
  
 ---- ----
Line 19: Line 19:
   * -u => update a file in an existing archive if the source is newer   * -u => update a file in an existing archive if the source is newer
   * -f => archive filename   * -f => archive filename
 +  * --selinux => include selinux contexts
  
 Archive and compress (using gzip) the /var/log directory Archive and compress (using gzip) the /var/log directory
Line 25: Line 26:
 </code> </code>
  
 +\\
 List contents of archive List contents of archive
 <code bash> <code bash>
Line 30: Line 32:
 </code> </code>
  
 +\\
 Decompress and unpack at the same time to current directory Decompress and unpack at the same time to current directory
 <code bash> <code bash>
Line 35: Line 38:
 </code> </code>
  
 +\\
 Decompress and unpack at the same time to a different existing directory Decompress and unpack at the same time to a different existing directory
 <code bash> <code bash>
Line 40: Line 44:
 </code> </code>
  
 +\\
 Add a new file to an existing archive Add a new file to an existing archive
 <code bash> <code bash>
Line 49: Line 54:
 ===== star ===== ===== star =====
  
 +Install (usually not there by default)
 +<code bash>
 +yum install star
 +</code>
 +
 +\\
 Archive and compress the /var/log directory (name it logs.tar.gz) Archive and compress the /var/log directory (name it logs.tar.gz)
 <code bash> <code bash>
Line 54: Line 65:
 </code> </code>
  
 +\\
 List archive contents List archive contents
 <code bash> <code bash>
Line 59: Line 71:
 </code> </code>
  
 +\\
 Decompress, unpack a bzip2 (star auto selects proper decompression type) Decompress, unpack a bzip2 (star auto selects proper decompression type)
 <code bash> <code bash>
Line 73: Line 86:
 </code> </code>
  
 +\\
 Decompress an archive Decompress an archive
 <code bash> <code bash>
Line 80: Line 94:
 </code> </code>
  
 +\\
 Cat a compressed file (useful for rotated logs) Cat a compressed file (useful for rotated logs)
 <code bash> <code bash>
Line 94: Line 109:
 </code> </code>
  
 +\\
 Decompress an archive Decompress an archive
 <code bash> <code bash>
Line 101: Line 117:
 </code> </code>
  
 +\\
 Cat a compressed file (useful for rotated logs) Cat a compressed file (useful for rotated logs)
 <code bash> <code bash>
  • linux_wiki/archive_compress_unpack_and_uncompress_files_using_tar_star_gzip_and_bzip2.1456718042.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)