Skip to main content

Linux: How to Zip and Unzip Files Using the Terminal

HardReset.InfoDecember 16, 20257 min59 views
4 connections·6 entities in this video→

Checking and Installing Zip/Unzip Tools

  • πŸ’‘ Terminal access is the first step for managing archives on Linux.
  • πŸ” Verify if zip and unzip are installed by typing zip --version and unzip --version.
  • πŸ› οΈ If tools are missing on Ubuntu/Debian, install them using sudo apt install zip unzip.

Creating Zip Archives

  • πŸ“¦ To zip individual files, use the command zip archive-name file1 file2.
  • 🎯 For example, zip files.zip file.txt file2.txt creates an archive named files.zip containing both text files.
  • πŸ“„ View the contents of a zip archive without extracting by using unzip -l archive.zip.

Extracting Zip Archives

  • πŸ“‚ To unzip files, use the command unzip archive.zip.
  • ⚠️ Be aware of potential name conflicts if files with the same names already exist in the destination directory; you can choose to replace or skip them.

Zipping and Unzipping Folders

  • πŸ“ To zip a folder and its contents recursively, use the -r option: zip -r archive-name folder-name.
  • πŸš€ Example: zip -r folder_with_files.zip folder will create an archive containing the specified folder and all its files and subdirectories.
  • πŸƒ To unzip a folder archive, use the standard unzip archive.zip command, which will recreate the folder structure.
  • πŸ—‘οΈ Folders can be removed using rm -r folder-name.
Knowledge graph6 entities Β· 4 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
6 entities
Chapters3 moments

Key Moments

Transcript26 segments

Full Transcript

Topics10 themes

What’s Discussed

LinuxZip FilesUnzip FilesTerminal CommandsUbuntuDebianArchive ManagementFile CompressionRecursive ZippingName Conflicts
Smart Objects6 Β· 4 links
ProductsΒ· 4
ConceptsΒ· 2