Added various Linux compression commands.

This commit is contained in:
Donne Martin 2015-03-03 10:17:10 -05:00
parent 47211cb729
commit a0ac867b7b

View File

@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:e883affbe4f831de766b4bd337b2a666c4fe8d4118dcbc66de26378b67472b39"
"signature": "sha256:4515e5f88373961da62945f02e97b93ca0c73478b952696d14d5cd396af307f1"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -222,17 +222,35 @@
"## Compression"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Uncompress all tar.gz in current directory to another directory"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Compress zip\n",
"zip -r archive_name.zip folder_to_compress\n",
"\n",
"# Compress zip without invisible Mac resources\n",
"zip -r -X archive_name.zip folder_to_compress\n",
"\n",
"# Extract zip\n",
"unzip archive_name.zip\n",
"\n",
"# Compress TAR.GZ\n",
"tar -zcvf archive_name.tar.gz folder_to_compress\n",
"\n",
"# Extract TAR.GZ\n",
"tar -zxvf archive_name.tar.gz\n",
"\n",
"# Compress TAR.BZ2\n",
"tar -jcvf archive_name.tar.bz2 folder_to_compress\n",
"\n",
"# Extract TAR.BZ2\n",
"tar -jxvf archive_name.tar.bz2\n",
"\n",
"# Extract GZ\n",
"gunzip archivename.gz\n",
"\n",
"# Uncompress all tar.gz in current directory to another directory\n",
"for i in *.tar.gz; do echo working on $i; tar xvzf $i -C directory/ ; done"
],
"language": "python",