{"id":1459,"date":"2013-10-21T12:46:14","date_gmt":"2013-10-21T12:46:14","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=1459"},"modified":"2014-09-26T15:05:13","modified_gmt":"2014-09-26T15:05:13","slug":"tar-for-zipping-files-directories-etc","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/command-line\/tar-for-zipping-files-directories-etc","title":{"rendered":"tar, for zipping files, directories, etc"},"content":{"rendered":"<h4>\nShow all options<br \/>\n<\/h4>\n<pre>\r\n<code>\r\ntar --help\r\n<\/code><\/pre>\n<p>\nCreate Archive Of Specific Files\n<\/p>\n<p>\ntar -vfcz&nbsp;outputfilename.gz inputfile1 inputfile2\n<\/p>\n<h4>\nZipping Files And Directories<br \/>\n<\/h4>\n<p>\nUse this to move to the directory containing the files and \/ or directories you want to zip\n<\/p>\n<pre>\r\n<code>\r\ncd projects\/myfolder\r\n<\/code><\/pre>\n<h5>\nZip 1 File<br \/>\n<\/h5>\n<pre>\r\n<code>\r\ntar -vczf zip_output_filename.gz file_to_zip.a\r\n<\/code><\/pre>\n<h5>\nZip 2 Files<br \/>\n<\/h5>\n<pre>\r\n<code>\r\ntar -vczf zip_output_filename.gz file_to_zip1.a file_to_zip2.a\r\n<\/code><\/pre>\n<h5>\nZip A File &amp; 2 Directories<br \/>\n<\/h5>\n<pre>\r\n<code>\r\ntar -vczf zip_output_filename.gz file_to_zip1.a directory_to_zip1 directory_to_zip2\r\n<\/code><\/pre>\n<p>\n&quot;-vczf&quot; are the options being used for the compress.\n<\/p>\n<h4>\n\u200bUnziping<br \/>\n<\/h4>\n<pre>\r\n<code>\r\ntar zxvf zip_filename.gz\r\n<\/code><\/pre>\n<p>\n&quot;zxvf&quot; are the options being used and will cause an overwrite if any files already exist\n<\/p>\n<p>\nNote that if&nbsp;a file was set as executable when zipped this permission will remain when it is unzipped whether overwriting an existing file or not.\n<\/p>\n<h4>\nUnzipping From Dropbox<br \/>\n<\/h4>\n<p>\nSee <a href=\"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/distribution-of-applicaitons\/distribution-using-dropbox\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Show all options tar &#8211;help Create Archive Of Specific Files tar -vfcz&nbsp;outputfilename.gz inputfile1 inputfile2 Zipping Files And Directories Use this to move to the directory containing the files and \/ or directories you want to zip cd projects\/myfolder Zip 1 File tar -vczf zip_output_filename.gz file_to_zip.a Zip 2 Files tar -vczf zip_output_filename.gz file_to_zip1.a file_to_zip2.a Zip A [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-1459","post","type-post","status-publish","format-standard","hentry","category-command-line"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=1459"}],"version-history":[{"count":7,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1459\/revisions"}],"predecessor-version":[{"id":1702,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1459\/revisions\/1702"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=1459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=1459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=1459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}