@smith_x
Linux Oct 26, 2026

Zip a whole folder including subfolders on Linux terminal

Tried zip with the folder name and it only made an empty archive. Need the full directory with all files inside, and the right command to unzip it again on another machine.
1

Leave A Reply

Log in to post an answer.

1 Answer

smith_x
zip -r archive.zip foldername the -r is the bit people miss. without it you get a zip with just the empty top folder in it and nothing inside. if it says zip isn't found, sudo apt install zip on ubuntu/debian. if it's only going to other linux machines, tar -czf foldername.tar.gz foldername does the same job and keeps file permissions intact.