{"id":168,"date":"2012-01-12T08:24:53","date_gmt":"2012-01-12T10:24:53","guid":{"rendered":"http:\/\/linuxrs.com.br\/?p=168"},"modified":"2012-01-20T08:38:51","modified_gmt":"2012-01-20T10:38:51","slug":"compactando-arquivos-no-linux","status":"publish","type":"post","link":"https:\/\/blog.clusterweb.com.br\/?p=168","title":{"rendered":"Compactando arquivos no Linux"},"content":{"rendered":"<p align=\"LEFT\"><span style=\"font-size: small\">Neste roteiro ser\u00e1 abordado as principais ferramentas para compacta\u00e7\u00e3o de arquivos e pastas. O empacotamento \u00e9 o ato de reunir v\u00e1rios arquivos e coloc\u00e1-los dentro de um outro, denominado arquivo pacote. Esse pacote possui um tamanho final pr\u00f3ximo \u00e0 soma dos arquivos que o comp\u00f5e, na verdade, o tamanho ficar\u00e1 ligeiramente menor em virtude de ser um \u00fanico arquivo. <\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>Ferramentas abordadas:<\/strong><\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"><strong> <\/strong>Tar e gzip <\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>Tar: <\/strong>Utilizado para compactar e descompactar arquivos, o arquivo original \u00e9 mantido, porem a extens\u00e3o .tar n\u00e3o \u00e9 especificada automaticamente.<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"><strong>Sintaxe: <\/strong>tar [op\u00e7\u00f5es] arquivo_empacotado arquiva_para_empacotar<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"> <strong>Principais op\u00e7\u00f5es do comando:<\/strong><\/span><\/p>\n<table width=\"527\" cellspacing=\"0\" cellpadding=\"4\">\n<col width=\"102\" \/>\n<col width=\"407\" \/>\n<tbody>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"CENTER\"><span style=\"font-size: small\"><strong>Op\u00e7\u00e3o<\/strong><\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"CENTER\"><span style=\"font-size: small\"><strong>Descri\u00e7\u00e3o<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-c<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Cria arquivo tar<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-r<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Acrescenta novos arquivosa um arquivo tar j\u00e1 existente<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-x<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Extrai o conteudo de um arquivo tar<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-P<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Restaura os arquivos com suas permiss\u00f5es originais<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-v<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Mostra o processo de compacta\u00e7\u00e3o ou descompacta\u00e7\u00e3o na tela<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-z<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Compacta e descompacta os arquivos atrav\u00e9s do gzip<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-f<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Especifica o arquivo a ser usado como entrada ou sa\u00edda<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-t<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Lista o conteudo de um arquivo compactado<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p align=\"LEFT\"><span style=\"font-size: small\"><strong>Tarefas:<\/strong><\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"><strong> 1-<\/strong>Use o comando tar para compactar um arquivo que o resultado gerado seja um arquivo com a extes\u00e3o .tar.gz.<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\">Tar -czvf arquivo.tar.gz arquivo<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>2-<\/strong> Liste o conte\u00fado do arquivo gerado pela tarefa anterior.<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\">Tar -tzvf arquivo.tar.gz<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>3-<\/strong> Descompacte o arquivo gerado na tarefa 1.<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\">tar -xzvf arquivo.tar.gz<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>gzip: <\/strong>Utilizado para compactar e descompactar arquivos, o arquivo original \u00e9 susbtituido por um arquivo com a extens\u00e3o .gz<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>Sintaxe:<\/strong> <span style=\"font-family: arial\">gzip [op\u00e7\u00f5es] arquivo<\/span><\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-family: arial\"><span style=\"font-size: small\"><strong>Principais op\u00e7\u00f5es do comando:<\/strong><\/span><\/span><\/p>\n<table width=\"527\" cellspacing=\"0\" cellpadding=\"4\">\n<col width=\"102\" \/>\n<col width=\"407\" \/>\n<tbody>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"CENTER\"><span style=\"font-size: small\"><strong>Op\u00e7\u00e3o<\/strong><\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"CENTER\"><span style=\"font-size: small\"><strong>Descri\u00e7\u00e3o<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-c<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Mantem o arquivo original inalterado<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-d<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Descompacta o arquivo<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-l<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Lista informa\u00e7\u00f5es sobre o arquivo<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-r<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Compacta e descompacta recursivamente<\/span><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"TOP\">\n<td width=\"102\">\n<p align=\"LEFT\"><span style=\"font-size: small\">-t<\/span><\/p>\n<\/td>\n<td width=\"407\">\n<p align=\"LEFT\"><span style=\"font-size: small\">Verifica integridade do arquivo compactado<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>Tarefas:<\/strong><\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>1-<\/strong>Use o comando gzip para compactar um arquivo.<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"> Gzip arquivo <\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>2- <\/strong>Compacte um arquivo e mantenha o original<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"> gzip -c arquivo<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>3- <\/strong>Compactar uma pasta recursivamente<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"> gzip -r pasta<\/span><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\"><strong>4-<\/strong> Descompactar a pasta do exerc\u00edcio anterior<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\"> gzip -dr pasta<\/span><\/p>\n<p align=\"LEFT\"><strong><span style=\"font-size: small\">Referencias Bibliograficas.<\/span><\/strong><\/p>\n<p align=\"LEFT\">\u00a0<span style=\"font-size: small\">http:\/\/www.uniriotec.br\/~morganna\/guia\/gzip.html<\/span><\/p>\n<p align=\"LEFT\"><span style=\"font-size: small\">Apostila Red Hat Enterprise Linux Administra\u00e7\u00e3o Avan\u00e7ada de Sistemas TargtTrust Agosto de 2009<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste roteiro ser\u00e1 abordado as principais ferramentas para compacta\u00e7\u00e3o de arquivos e pastas. O empacotamento \u00e9 o ato de reunir v\u00e1rios arquivos e coloc\u00e1-los dentro de um outro, denominado arquivo pacote. Esse pacote possui um tamanho final pr\u00f3ximo \u00e0 soma dos arquivos que o comp\u00f5e, na verdade, o tamanho ficar\u00e1 ligeiramente menor em virtude de [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1,51],"tags":[119],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-viazap","category-linux-linuxrs","tag-compactando-arquivos"],"_links":{"self":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168"}],"version-history":[{"count":2,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/168\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/168\/revisions\/221"}],"wp:attachment":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}