<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; tar</title> <atom:link href="http://www.ghacks.net/tag/tar/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Fri, 10 Feb 2012 13:29:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Get to know Linux: File compression</title><link>http://www.ghacks.net/2010/01/22/get-to-know-linux-file-compression/</link> <comments>http://www.ghacks.net/2010/01/22/get-to-know-linux-file-compression/#comments</comments> <pubDate>Fri, 22 Jan 2010 18:22:57 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Desktop Manager]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[archives]]></category> <category><![CDATA[bunzip]]></category> <category><![CDATA[bzip2]]></category> <category><![CDATA[dolphin]]></category> <category><![CDATA[file compression]]></category> <category><![CDATA[gzip]]></category> <category><![CDATA[linux compression]]></category> <category><![CDATA[nautilus]]></category> <category><![CDATA[tar]]></category> <category><![CDATA[zip]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=22512</guid> <description><![CDATA[How many times have you come across a .tar, .tgz, or .bz2 file in Linux and had no idea what to do with it? Or what it was? Most users of computers know what the .zip file is. Simple, it&#8217;s a compressed file. And to uncompress you generally double click it or right click and [...]]]></description> <content:encoded><![CDATA[<p>How many times have you come across a .tar, .tgz, or .bz2 file in Linux and had no idea what to do with it? Or what it was? Most users of computers know what the .zip file is. Simple, it&#8217;s a compressed file. And to uncompress you generally double click it or right click and select Extract. Most people recognize that from the world of Windows. But did you know that file compression/decompression is just as easy in the world of Linux? It is. The only problem is that most don&#8217;t recognize what files are, in fact, compressed files, archives, or compressed archives.</p><p>In this article I am going to de-mystify Linux file compression and archiving for you. By the end of the article you&#8217;ll be compressing and decompressing files in your sleep. And, as a bonus, you&#8217;ll know how to do this both via command line and GUI.</p><p><span
id="more-22512"></span><strong>Compression versus archiving</strong></p><p>The difference between compression and archiving is simple: Compression makes a file (or directory) smaller and Archiving takes many seperate files (such as a directory containing sub-directories and/or files) and turns it into a single file. You can have a compressed archive (such as .tar.gz or .tgz) and you can even have an archive of compressed files (such as a directory that contains a bunch of compressed files). But how do you know what are compressed files verses archived files? Here&#8217;s a list of file extensions and what they are.</p><p>.tar &#8211; This is an uncompressed Tar archive file. This type of archive is unpacked with the command <em>tar xvf file.tar</em>.</p><p>.tgz &#8211; This is a compressed Tar archive file. This type of archive is decompressed and unpacked with the command <em>tar xvzf file.tgz</em>.</p><p>.gz &#8211; This is a file compressed with the gzip program. This type of file is decompressed with the command <em>gunzip file.gz</em>.</p><p>.zip &#8211; This is a compressed file. This type of file is decompressed with the command <em>unzip file.zip</em></p><p>.bz2 &#8211; This is a compressed file. This type of file is decompressed with the command <em>bunzip2 file.bz2.</em></p><p><strong>Which compression to use?</strong></p><p>Of the three compression utilities (bzip2, zip, and gzip) the tool that will result in the most compression (the smallest file) is bzip2. The only disadvantage to bzip2 is that the algorithm uses more processor to complete than does the other utilities.</p><p>If you are sharing your compressed files with Windows users your best bet is to use zip for compression. Although there are tools (such as <a
title="Stuffit Delux" href="http://www.stuffit.com/win-deluxe.html" target="_blank">Stuffit Deluxe for Windows</a>) that can handle bz2 files, the default supported is .zip.</p><p><strong>Using the GUI</strong></p><p>If you are a fan of the GUI (and who isn&#8217;t these days?) you will be glad to know that most all Linux file managers can handle compressed and archived files. In both Nautilus (GNOME) and Dolphin (KDE) you can simply right click a compressed, archived, or compressed archive file and select Extract. Both file managers also offer compression and archiving options when you right click a file or directory.</p><p><strong>Final thoughts</strong></p><p>Working with compression and archiving is very simple with the Linux operating system. You have plenty of options in both the command line and the GUI worlds.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/01/22/get-to-know-linux-file-compression/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Create Archives with File Roller</title><link>http://www.ghacks.net/2009/02/26/create-archives-with-file-roller/</link> <comments>http://www.ghacks.net/2009/02/26/create-archives-with-file-roller/#comments</comments> <pubDate>Thu, 26 Feb 2009 21:22:49 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tools]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[archives]]></category> <category><![CDATA[File Roller]]></category> <category><![CDATA[tar]]></category> <category><![CDATA[untarring]]></category> <category><![CDATA[unzipping]]></category> <category><![CDATA[zip]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10762</guid> <description><![CDATA[There are a number of reasons you would need to an archive. You might need to create backup archives of files, or you might want to be able to store project files together. Whatever your reason, the GNOME File Roller tool makes creating archives simple. File Roller is the Winzip of Linux. Of course you [...]]]></description> <content:encoded><![CDATA[<p>There are a number of reasons you would need to an archive. You might need to create backup archives of files, or you might want to be able to store project files together. Whatever your reason, the GNOME File Roller tool makes creating archives simple. File Roller is the Winzip of Linux.</p><p>Of course you can do the same thing, quickly, from the command line. But, for many, the choice between a user-friendly GUI tool and the command line is a no-brainer.</p><p><span
id="more-10762"></span>With File Roller you can both create archives and unpack archives. File Roller deals with the following types:</p><ul><li>.tar</li><li>.tar.gz</li><li>.tar.bz2</li><li>.tar.lzma</li><li>.jar</li><li>.ar</li><li>.cbz</li><li>.zip</li></ul><p>File Roller also does automatic archive typing, so when you are opening an archive you do not have to declare the type.</p><p><strong>Running File Roller</strong></p><div
id="attachment_10796" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/02/file_roller_main.png"><img
class="size-medium wp-image-10796" src="http://www.ghacks.net/wp-content/uploads/2009/02/file_roller_main-500x400.png" alt="File Roller Main Window" width="300" height="240" /></a><p
class="wp-caption-text">File Roller Main Window</p></div><p>From the GNOME main menu you will find File Roller in the Accessories sub-menu of the Applications menu. When File Roller opens you will be presented with a fairly blank window.</p><p>From the main window you can either open an archive for unpacking or create a new archive. When you create a new archive what you are doing is first creating a folder that will contain all of the files, and then File Rollers packs everything up for you automatically.</p><p>Let&#8217;s create an archive for example&#8217;s sake.</p><p><strong>Creating An Archive</strong></p><p>The first thing to do is click the New Button. When you do this a File dialog will open where you will name your archive. This window can be deceiving because it looks like it wants you to select a file. That is not the case. What you want to do is enter the name of your new Archive in the <strong>Name</strong> text field. Once you have done that select the type of archive you want to create. After you have taken care of those two options, click the Create button.</p><p>At first glance you might think nothing happened. Look again at the title bar of the File Roller window and you will notice the file name of your new archive (see the image to the right).</p><div
id="attachment_10797" class="wp-caption alignright" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/02/file_roller_titlebar.png"><img
class="size-medium wp-image-10797" src="http://www.ghacks.net/wp-content/uploads/2009/02/file_roller_titlebar-500x142.png" alt="TEST.tar.gz" width="300" height="85" /></a><p
class="wp-caption-text">TEST.tar.gz</p></div><p>Now it&#8217;s time to add files and/or folders to your archive. To add a file(s) click the Add Files button. To add multiple files at once click and hold the Ctrl key as you select files. Once you are satisfied with the files you have added click the Add button. What you will see now is the main File Roller window with your files included.</p><div
id="attachment_10798" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/02/file_roller_files.png"><img
class="size-medium wp-image-10798" src="http://www.ghacks.net/wp-content/uploads/2009/02/file_roller_files-500x294.png" alt="Your Archive Is Ready" width="300" height="176" /></a><p
class="wp-caption-text">Your Archive Is Ready</p></div><p>You don&#8217;t have to save your archive. Once the files are added, the archive is ready. You can check your home directory and you will find it waiting for you.</p><p>Don&#8217;t think, however, the only thing you can now do is unpack your archive. With this archive open you can add more files or directories. simply go through the process again to add more.</p><p><strong>Extracting an Archive</strong></p><p>Extracting an archive is very simple. Open a new session of File Roller, click the Open button, select the archive you want to extract, and click the Open button. Once the archive is open you will see the entire contents of the archive. That doesn&#8217;t mean the archive is unpacked. In order to unpack the archive you have to hit the Extract button. Once you do that you will have to select a location to extract the contents to. This is a nice feature because, without this step, you could easily fill your ~/ directory with the contents of the archive.</p><p><strong>Final Thoughts</strong></p><p>I have always been a fan of the command line, because I was weened on Linux with the command line. But for those who do not have the time or inclination to learn the command line, tools like File Roller are ideal for accomplishing every day tasks like unpacking archives.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/02/26/create-archives-with-file-roller/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Installing Firefox and Flash From Source</title><link>http://www.ghacks.net/2009/02/19/installing-firefox-and-flash-from-source/</link> <comments>http://www.ghacks.net/2009/02/19/installing-firefox-and-flash-from-source/#comments</comments> <pubDate>Thu, 19 Feb 2009 17:39:41 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Browsing]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bunzip2]]></category> <category><![CDATA[flash]]></category> <category><![CDATA[flash plugin]]></category> <category><![CDATA[source]]></category> <category><![CDATA[tar]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10663</guid> <description><![CDATA[Normally you will hear me professing to always install using your Linux distributions&#8217; package management system. This is true for most cases. There is one case, however, that defies that philosophy: Installing Firefox. I have, on many occasions, installed Firefox using the distributions package management system only to have issue with either plugins or updates. [...]]]></description> <content:encoded><![CDATA[<p>Normally you will hear me professing to always install using your Linux distributions&#8217; package management system. This is true for most cases. There is one case, however, that defies that philosophy: Installing Firefox. I have, on many occasions, installed Firefox using the distributions package management system only to have issue with either plugins or updates. Because of this, one of the first things I do after a fresh installation is install Firefox from source. This gives you more control over the application which will ensure things run much more smoothly.</p><p>Naturally the first thing you will need to do is to download the <a
title="Firefox" href="http://www.mozilla.com/en-US/firefox/" target="_blank">Firefox source</a>. Once the source is downloaded you have a choice to make. You can install Firefox for each user on the system (if there is only one user you don&#8217;t really have much to worry about) or you can install Firefox &#8220;system wide&#8221;. If you choose to install for just one user then place the source file in the users home directory. If you want to install it &#8220;system wide&#8221; move the file to the <strong>/opt</strong> directory (you will have to have root permissions or use sudo to do this.)</p><p><span
id="more-10663"></span>Now that the file is in place it is time to unpack the file. More than likely the source package will be in bunzip2 format. To unpack the file you will issue the command <em>bunzip2 firefox-XXX.tar.bz2</em>. (Where <em>XXX</em> this the release number you downloaded.) Once bunzip2 has done its thing you will be left with a tar file <em>firefox-XXX.tar</em> (Again where <em>XXX</em> is the release number.)</p><p>When you unpack the Firefox tar file a new directory will be created called simply <strong>firefox</strong>. This new directory contains everything Firefox needs to run. All you have to do now is issue the command <em>~/firefox/firefox </em>to start up the browser.</p><p><strong>Starting Firefox</strong></p><p>Naturally you don&#8217;t want to have to start Firefox from command line every time you want to run the browser. What you will want to do is edit the preferences in either your menu entries or the Firefox application icons on either your Panel or your desktop. When you do edit the preferences you will want to change the command entry. The entry that came with the pre-installed Firefox will most likely be:</p><p><em>firefox %u</em></p><p>You will to change that to:</p><p><em>~/firefox/firefox %u</em></p><p><strong>Installing Flash</strong></p><p>Once you have Firefox up and running you can install plugins manually. For instance, installing the Macromedia Flash plugin involves downloading the <a
title="Flash" href="http://www.adobe.com/" target="_blank">Flash plugin</a>, (download the source, not the binary) unpacking the file with the command: tar xvzf install_flash_player_10_linux.tar.gz, change into the newly created directory with the command <strong>cd install_flash_player_10</strong>, issue the command <em>./flashplayer-installer, </em>and answer the necessary questions. When you are asked where the installation directory is you will enter <em>~/firefox</em>.</p><p>You&#8217;re done. Now you can fire up Firefox and enter <em>about:plugins</em> to make sure the flash player plugin is installed (it will also tell you which flash version you are using.)</p><p><strong>Final Thoughts</strong></p><p>It may not be the easiest method of installation, but it&#8217;s the best when you want to have more control over your web browser. You will also find it much easier to keep up to date with both the browser itself as well as the plugins you install.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/02/19/installing-firefox-and-flash-from-source/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Back up your Apache web directory and database with this simple script</title><link>http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/</link> <comments>http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/#comments</comments> <pubDate>Thu, 22 Jan 2009 18:58:34 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[automated backups]]></category> <category><![CDATA[backup-solution]]></category> <category><![CDATA[backups]]></category> <category><![CDATA[cat]]></category> <category><![CDATA[cron]]></category> <category><![CDATA[date]]></category> <category><![CDATA[LAMP]]></category> <category><![CDATA[tar]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10060</guid> <description><![CDATA[I administer a lot of web sites. And all of these web sites need backup solutions. Since most of those web sites use LAMP servers it only made sense to set up a backup system using the available, included open source tools. It didn&#8217;t take long to create a solid backup system and, with the [...]]]></description> <content:encoded><![CDATA[<p>I administer a lot of web sites. And all of these web sites need backup solutions. Since most of those web sites use LAMP servers it only made sense to set up a backup system using the available, included open source tools. It didn&#8217;t take long to create a solid backup system and, with the help of cron, automate that system so that Apache&#8217;s document root and the website databases were backed up regularly and without user intervention.</p><p>The script made use of the following tools: date, cat, tar, mv, and rm. That&#8217;s it. The script will create backups with the date in the file name and then move the backups to a central location. Without further adieu, let&#8217;s get to the script.</p><p><span
id="more-10060"></span><em>#! /bin/sh</em></p><p><em>TMP=&#8221;/tmp/&#8221;</em></p><p><em>#Format the date in YEAR-MO-DY format<br
/> TODAY=`date +%F`</em></p><p><em># Check to see if there is a lastbackup file in /tmp, if not create it,<br
/> # if so then set LAST equal to $TODAY<br
/> if [ -f /tmp/lastbackup ]; then<br
/> LAST=`cat /tmp/lastbackup`<br
/> else<br
/> LAST=$TODAY<br
/> fi</em></p><p><em># Set the web directory backup name to the following<br
/> WEB_FILENAME=&#8221;inc-&#8221;$TODAY&#8221;-web.tar.gz&#8221;</em></p><p><em># Set database backup name to the following<br
/> DB_FILENAME=&#8221;inc-&#8221;$TODAY&#8221;-db.tar.gz&#8221;</em></p><p><em># this tars up my web directory into web.tar.gz tarball.<br
/> /bin/tar -czf $TMP$WEB_FILENAME &#8211;after-date=$LAST /var/www/html</em></p><p><em># Move the web back to the backup directory<br
/> /bin/mv $TMP$WEB_FILENAME /data</em></p><p><em># Remove web backup file from temp director<br
/> rm $TMP$WEB_FILENAME</em></p><p><em># this tars up my database directory into $TODAY-db.tar.gz tarball.<br
/> /bin/tar -czf $TMP$DB_FILENAME &#8211;after-date=$LAST /var/lib/mysql</em></p><p><em># Move the backup database to the backup directory<br
/> /bin/mv $TMP$DB_FILENAME /data</em></p><p><em># Remove web backup file from temp directory<br
/> rm $TMP$DB_FILENAME<br
/> </em></p><p>What I wanted this to do is create daily backups and move the backups to the <strong>/data</strong> directory on the drive housing the server. These backups will be saved for one month. After the month is completed i have a second script that deletes the months backups prior to running the next backup (so there is always a backup to fall to). How I made use of this script is simple. I save the script (called <strong>backup.sh</strong>) in the root user directory and create a second script called <strong>rm_backups.sh</strong> that looks like this:</p><p><em>#! /bin/sh</em></p><p><em>rm /data/*gz</em></p><p>With these two files in place I create two cron entries. The first cron entry is for running the <strong>backup.sh</strong> script and looks like:</p><p>0 23 * * *     ~/backup.sh</p><p>The second cron entry is for running the <strong>rm_backups.sh</strong> script and looks like:</p><p>0 20 1 * *     ~/rm_backups.sh</p><p>Both of the above cron jobs are created as the root user.</p><p><strong>Final Thoughts</strong></p><p>Naturally this solution could be easily modified (using such tools rsync) to set up an offsite backup solution. What should be obvious is that creating a simple, flexible server backup system on Linux is easy. With the help of a little ingenuity, you can create your own automated backup service.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
