Archive and Compress a Directory
Labels:
shell
Archive, ZIP/Unzip and Compress/Decompress a Directory
$ tar -zcvf archive.tar.gz sourcedirectory/
Exclude a directory(s) from the archive:
$ tar -zcvf archive.tar.gz sourcedirectory/ --exclude=exclude01-dir/* --exclude=exclude02-dir/subdir/*
ZIP
$ zip db.zip foo-file
$ zip -r dir.zip directory/
Extract contents of a GZ archive
$ gunzip archive.sql.gz
or
$ gzip -d archive.sql.gz
Extract contents of a TAR GZ Archive
$ tar -zxvf archive.tar.gz
No comments:
Post a Comment