- Compress a file (
filename.sql
will be replaced by filename.sql.xz
)
xz filename.sql
- Uncompress file (
filename.sql.xz
will be replaced by filename.sql
)
xz -d filename.sql.xz
- Compress folder
tar -cJvf folder.tar.xz folder/
- Uncompress folder
tar -xJvf folder.tar.xz folder/
- Compress file from stdin
mysqldump mydatabase | xz > mydump.sql.xz
- Uncompress and send content to stdout
xzcat mydump.sql.xz | mysql mydatabase
- Uncompress tar folder from stdin sent from ncat
ncat -l -p 7000 | tar -xJvf -
- Compress folder to stdout and send to ncat
tar -cJvz - folder/ | ncat targetserver.com 7000