LWM-Linux/06 - Linux File Operations/Compression and Archiving.md

30 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Certainly! Let's delve into compression and archiving using **gzip** and **tar** in **Linux Mint**:
1. **Tar (Tape Archive)**:
- **Tar** combines multiple files or directories into a single archive file.
- Basic usage:
- To create a tar archive: `tar -cvf archive.tar files_or_directories`
- To extract from a tar archive: `tar -xvf archive.tar`
- Combine with compression tools for smaller archives.
2. **Gzip**:
- **Gzip** compresses files individually.
- Basic usage:
- To compress a file: `gzip filename` (creates `filename.gz`)
- To decompress: `gzip -d filename.gz`
3. **Combining Tar and Gzip**:
- Create a compressed tar archive (`.tar.gz` or `.tgz`):
```
tar -czvf archive.tar.gz files_or_directories
```
Remember, these commands help manage files efficiently! Feel free to explore further or ask more questions. 😊🚀
Source: Conversation with Copilot, 7/12/2024
- [(1) How to obtain maximum compression with .tar.gz? - Super User.](https://superuser.com/questions/514260/how-to-obtain-maximum-compression-with-tar-gz.)
- [(2) How to Compress and Extract Files Using the tar Command on Linux.](https://www.howtogeek.com/248780/how-to-compress-and-extract-files-using-the-tar-command-on-linux/.)
- [(3) File Compression and Archiving Using tar, gzip, zip, etc..](https://cfcs2r.com/index.php/courses/linux-file-system-basics/lessons/file-compression-and-archiving-using-tar-gzip-zip-etc/.)
- [(4) Tar command Compress and Extract Archives - ComputerNetworkingNotes.](https://www.computernetworkingnotes.com/linux-tutorials/tar-command-compress-and-extract-archives.html.)
- [(5) How to archive a file with tar gz. and gzip command..](https://nexonhost.com/how-to-archive-a-file-with-tar-gz-and-gzip-command/.)