Posts Tagged ‘winrar’

WinRAR Goes Portable! (Finally)

Friday, March 16th, 2007

WinRAR Unplugged 3.62 Screenshot WinRAR finally made the big step and went portable! The announcement came today via a press release and is currently featured on the official site of WinRAR but not RarLab.

The version number for WinRAR Unplugged is 3.62 despite the latest WinRAR for Windows version being 3.70 Beta 4.

As with all portable software, WinRAR Unplugged can be installed on any removable storage device (USB Stick, Memory card, External HDD) and then can be used on any computer that device is connected to.

WinRAR Unplugged 3.62 ScreenshotSomething worth of note: existing WinRAR licenses can be used with Unplugged, a new one is not required (GG, win.rar!).

Install is actually too big of a word, since the process consists of simply uncompressing the contents of the WinRAR Unplugged kit on the storage device of your choice. The easiest way to do this is download the self-extracting kit, copy it to the storage device, run it and watch as it unpacks itself in that location. Alternatively, you can save it on your internal HDD, run it and point it to unpack the contents on the external storage device.

After the “installation” is complete, all you need to do is go to the “WinRAR Unplugged” folder and double click the “Launch WinRAR.exe” file. This will start the WinRAR Unplugged Launcher, which stays in the systray and allows you to start the actual program. The launcher stays around even if you close WinRAR, you need to manually close it by right clicking on the systray icon and choosing “Exit”.

One thing you should be warned about is you should never ever disconnect the device that contains WinRAR Unplugged while the program or the launcher is still running, as doing so may cause data loss on that device or even (rarely) hardware damage.

WINRAR UNPLUGGED DOWNLOAD
Get it now: Download WinRAR Unplugged 3.62 Beta
(.exe SFX 1.80MB, MD5: CFCE9D11A059BC7DC3A3A3AE3C677D71)

More information: WinRAR Unplugged Info page

WINRAR UNPLUGGED FEATURES
- Use WinRAR anywhere

- When you place WinRAR on an external device, you can use it (including your profiles, AV-Code, themes, etc.) anywhere a Windows PC is available.

- Complete storage and backup solution

- Do you like to have your personal data with you on an external device when travelling? Now you can take WinRAR Unplugged with you on your external drives. With WinRAR unplugged you can manage your data just like at home - anywhere you go!

- Safe and secure

- When you remove the device with WinRAR Unplugged, all your information is secure and leaves with you.

- All included - Your personal license key for WinRAR is also valid for WinRAR Unplugged!

- International

- WinRAR Unplugged supports 7 interchangeable languages within one version! Supported languages: English, French, Italian, German, Spanish, Japanese and simplified Chinese.

WinRAR embarks on the Vista wave!

Tuesday, January 16th, 2007

WinRAR 3.71 Screenshot It was high time WinRAR joined the Vista-compatible club, and this new beta accomplishes just that.

WinRAR 3.71 Beta 1 packs a host of changes, many of which aim to make the program more compliant to the Windows Vista standards. This is obvious if we take a look at the new help facility, which dropped the old HLP format in favor of the (not-so-new-anymore) CHM system, a change that does not affect the program’s functionality, but was demanded by the Vista guidelines.

The other changes are, however, more noticeable. WinRAR now complies to the new security model and makes use of the administrator permission dialogs Vista users are already accustomed with. Logfiles, themes, settings and regkeys are now stored by default in the %APPDATA%\WinRAR folder, which is the preferred method in Vista (still, users can specify a different, custom folder).

From the non-Vista-related changes crowd the following stand out: UDF support for the ISO format, Unicode support for filenames in ISO images, design changes in the “Extract” dialog and a stack overflow fix.

Downloads and useful links follow. The detailed list of changes in this release is also included.

*** DOWNLOADS AND OTHER LINKS ***

Read: My complete WinRAR Review

Download the WinRAR Vista Ultimate theme: 48×48 64×64 80×80 96×96

Download WinRAR 3.71 Beta 1 for Windows
(exe installer - 1.1MB, MD5 Hash: E8FAC88B68431EAB085513F72F480EF3)

Download RAR 3.71 Beta 1 for Linux
(.tar.gz package, 751KB)

Download RAR 3.71 Beta 1 for FreeBSD
(.tar.gz package, 700KB)

Download RAR 3.71 Beta 1 for MacOS X
(.tar.gz package, 357KB)

Browse: WinRAR FTP Directory (other languages, themes, older releases)


*** WHAT’S NEW IN WINRAR 3.71 BETA 1 ***

1. Numerous Windows Vista compatibility changes:

a) help format changed from old HLP to newer HTML based CHM;

b) GUI self-extracting modules attempt to request for
administrator permissions if they cannot create destination
folder under current user account;

c) Log file rar.log and WinRAR theme files are stored
in %APPDATA%\WinRAR folder instead of WinRAR program files folder.

Exported settings file settings.reg is also stored
in %APPDATA%\WinRAR folder by default, but it is possible to
select another folder in “Save WinRAR settings” and “Load WinRAR
settings” dialogs.

WinRAR searches for registration key and settings.reg
both in its program files folder and in %APPDATA%\WinRAR;

d) Vista compatibility changes in WinRAR shell integration.

2. Added support for ISO 13346 (UDF) file format. This format
is frequently used in ISO images of DVD disks.

3. Added Unicode support for ISO 9660 files, so WinRAR should
handle non-English file names in .iso files better.

4. Design changes in window displaying archiving and extraction
progress:

a) it provides more space for file names, allowing lengthy names;

b) it displays the current archive name in separate line,
allowing much longer archive names than before;

c) when archiving, it displays the current compression ratio
in separate line;

d) it can use both standard Windows and classic WinRAR progress bars.
Turn on “Windows progress bars” option in WinRAR “Settings/General”
dialog to use standard progress bars. By default this option is
on if some Windows visual style is active and off if Windows Classic
theme is selected.

Windows progress bars are two color only, so they do not indicate
the current compression ratio. But now the ratio is displayed
in separate line;

e) “Mode…” button moved to bottom of window.

5. GUI self-extracting modules support following command line
switches:

-d set the destination path
-p specify a password
-s silent mode, hide all
-s1 same as -s
-s2 silent mode, hide start dialog
-sp specify parameters for setup program

6. GUI self-extracting modules do not pass the entire command line
to setup program like they did in previous versions.
If you need to get access to entire command line of SFX archive,
parse sfxcmd environment variable which contains this command line.

7. New switch -sc[objects] allowing to select character
sets for archive comments and list files. It replaces -fcu switch
introduced in RAR 3.60, which was removed from list of supported
switches. Now you need to specify -scuc instead of -fcu to use
Unicode comments. Unlike -fcu, -sc also supports OEM and ANSI charset.

8. New “Save archive copy as…” command in “File” menu.
This command may be useful if you opened an archive from Internet
directly in WinRAR and then decided to save it on local disk.

9. “Word wrap” command added to “View” menu of WinRAR internal viewer,
so you can change the wrapping mode of already opened viewer window.

State of this option is not stored between viewing sessions.
If you need to change the default word wrap mode, use WinRAR
“Settings/Viewer” dialog.

10. Buttons “Up” and “Down” added to “Organize profiles” dialog.
Using these buttons you can change position of selected profile
in the list.

11. Operation progress is displayed when adding the recovery record.

12. If WinRAR is minimized to tray and mouse is over its icon,
WinRAR diplays a message about the current operation progress.
In previous versions it included only percent done, now it also
contains the time left information.

13. Console RAR displays “Calculating the control sum” message
when calculating CRC32 control sum for newly created RAR volume.
Previous versions also calculated the volume control sum,
but did it silently.

14. Archives history list in “File” menu allows Unicode names,
providing more reliable support for non-English archive names.

15. Stack overflow vulnerability has been corrected in password
processing module of console RAR and UnRAR. GUI WinRAR is not
affected. We are thankful to the iDEFENSE LABS for reporting this bug.

WinRAR 3.62 fixes 7-Zip archive handling vulnerability

Tuesday, December 5th, 2006

WinRAR 3.62 Screenshot WinRAR 3.62 is a release clearly dedicated to improving modules that handle third-party compression formats, 7z and gzip to be more precise.

The fix for 7-Zip’s format is the most notable since it targets a stack overflow vulnerability.

The bug in gzip handling was, at most, an inconvenience: sometimes the date for an extracted file could be set incorrectly.

Apparently, these flaws affected only the Windows build of WinRAR, since the version numbers for the Linux, BSD and Mac OS X build are the same (3.60).

*** WHAT’S NEW IN WINRAR 3.62 ***

- Stack overflow vulnerability has been corrected in WinRAR module processing 7-Zip archives;
- WinRAR GZip module could set a wrong file date when unpacking GZip archives.

*** DOWNLOAD AND OTHER LINKS ***

WinRAR Review

Download WinRAR 3.62 for Windows (exe installer - 1MB, MD5 Hash: 15CE577F46BDA1DFA2C8B10A8D0A02E5)

Download RAR 3.60 for Linux
(.tar.gz package, 735KB)

Download RAR 3.60 for FreeBSD
(.tar.gz package, 700KB, md5 = 25B783A1D98E1311002244E40380D91B)

Download RAR 3.60 for MacOS X
(.tar.gz package, 357KB, md5 = 41E6B7F4A9ABC797B612DAD55D3DCC3D)

Browse FTP Directory (other languages, themes, older releases)

WinRAR 3.61 plays nicer with Windows 95

Thursday, September 14th, 2006

WinRAR 3.61 ScreenshotWinRAR 3.61 has been posted today on the Rarlab download site. Only the Windows GUI and command line versions have been updated. The DOS, Mac OS X, Linux, FreeBSD ports are still at 3.60.

This is basically a bugfix release - it addresses a flaw in the multithreaded text compression module. Singlethreaded mode and other platforms than Windows were not affected.

Another issue that was fixed prevented WinRAR 3.60 from running on Windows 95. (It’s nice to see that, even mother Microsoft has banished its sibling - Win95 -, software developers strive to continue supporting their software on this platform.)

See below for the full changelog information.

*** WHAT’S NEW IN WINRAR 3.61 ***

- Corrected a bug in multithreaded text compression module, which under some circumstances might result in corrupt archived data.
This bug was present only in multithreaded mode and only in WinRAR 3.60. RAR versions for other platforms are not affected.

- Resolved a compatibility issue preventing WinRAR 3.60 to run in Windows 95.

*** RELEVANT LINKS ***

WinRAR Review

Download WinRAR 3.61 for Windows (.exe - 1MB, md5=75059AB2727FCB7244B57690625FC582)

Download RAR 3.60 for Linux (.tar.gz package, 735KB, md5 = 50C530F0896CFF4F922BB480CCB1AA18)

Download RAR 3.60 for FreeBSD (.tar.gz package, 700KB, md5 = 25B783A1D98E1311002244E40380D91B)

Download RAR 3.60 for MacOS X (.tar.gz package, 357KB, md5 = 41E6B7F4A9ABC797B612DAD55D3DCC3D)

Browse FTP Directory (other languages, themes, older releases)

WinRAR 3.60 Finally Released: Multithreaded, Faster, Folder Tree Panel

Wednesday, August 16th, 2006

WinRAR 3.60 Screenshot The final version of WinRAR 3.60 is out now! Here’s a download link to feed the impatient (MS-DOS, MacOS X, Linux, FreeBSD, PocketPC).

WinRAR 3.60, the compression giant’s latest stable version since 3.51, brings forth several new features such as multithreading support for multiprocessor/hyperthreading/dual-core computers, up to 15% compression speed boost, explorer-style treeview panel for both file and archive mode, command line archive conversion.

Other various improvements (see full list of changes below) target archive handling and manipulation, LZH/lh7 decompression support, better benchmark tool options and several command line commands and switches.

The Linux, FreeBSD, MacOS X and PocketPC ports have been updated as well to version number 3.60.

*** WHAT’S NEW IN WINRAR 3.60 FINAL ***

1. Multithreaded version of RAR compression algorithm improves
the compression speed on computers with several CPU,
dual core CPU and processors with hyperthreading technology.
Multithreading is enabled by default, but you can disable it
in “General” part of “Settings” dialog.

In the command line mode you can control multithreading with
-mt switch.

2. WinRAR can display the folder tree panel allowing to navigate
in disk and archive folders. Use “Options/Folder tree” submenu
to enable the folder tree. It can be configured separately
in file and archive management modes.

Folder tree replaces “Browse for folder” command previously
available in “File” menu and uses its Ctrl+T keyboard shortcut.

3. Now WinRAR “Rename” command also works with ZIP archives.
Previous versions could rename files only in RAR archives.

4. Added decompression of LZH archives created with “-lh7-” algorithm.

5. New “Remove duplicate folders from extraction path” option
in “Settings/Compression” dialog.

If this option is on and you unpack an archive which root folder
has no files and only one ’somename’ folder and if destination
folder is new or empty and also ends with ‘/somename’, WinRAR
will exclude one ’somename’ from resulting ’somename/somename’ path.

6. New “Define volume sizes…” button in “Settings/Compression”.
This button activates “Define volume sizes” dialog. Here you
can customize the list of predefined volume sizes associated
with “Split to volumes, bytes” field in archiving dialog.

7. Speed of RAR general compression increased for some data types.
Depending on data type and size the gain may achieve 5 - 15%.

8. New “Rename automatically” option in the extraction dialog
and command line -or switch to rename extracted files automatically
if file with the same name already exists. You can also enable
the auto-renaming mode directly from the overwrite confirmation
prompt with “Rename All” button.

Renamed files will get names like ‘filename(N).txt’,
where ‘filename.txt’ is the original file name and ‘N’ is a number.

9. “Set modification time” option in “Advanced” part of extraction
dialog is accessible also for ZIP archives. Previously it could be
changed only for RAR archives.

10. “Multithreading” option added to “Benchmark and hardware test”
command, so you can compare performance of usual and multithreaded
versions of RAR compression algorithm.

11. New ‘ch’ (change archive parameters) command line mode command.
Its purpose is to apply switches like -av, -tl and -cl to archive.

12. New ‘cv’ command line mode command. It provides the command line
interface to WinRAR “Convert archives” command. It is supported
only by winrar.exe, not by rar.exe.

13. New command line -sl and -sm switches to set size
limits of processing files.

14. New command line -fcu[file] switch allows to read archive
comments from Unicode files. It also modifies behavior
of “cw” command, setting the comment output format to Unicode.

15. 7Z added to list of formats stored without compression
when using -ms switch without a parameter.

16. Switch -e[+] is now supported by most of command line
operations including extracting and deleting files. Previously
it was supported by only archiving command.

17. It is allowed to use environment variables in archive name
in archiving dialog, in destination path in extraction dialog,
in folder names on “Compression” and “Paths” pages in WinRAR
settings. For example, you can enter ‘%temp%’ in “Folder for
temporary files” field.

*** RELEVANT LINKS ***

Download WinRAR 3.60 Final for Windows (.exe installer, 1MB, md5 = C05F9669B7ED0CABC278F0A68AA683E2)

Download RAR 3.60 for Linux (.tar.gz package, 735KB, md5 = 50C530F0896CFF4F922BB480CCB1AA18)

Download RAR 3.60 for FreeBSD (.tar.gz package, 700KB, md5 = 25B783A1D98E1311002244E40380D91B)

Download RAR 3.60 for MacOS X (.tar.gz package, 357KB, md5 = 41E6B7F4A9ABC797B612DAD55D3DCC3D)

Free WinRAR Registrations. Get it Quickly - Offer Starts and Ends Today!

Sunday, July 30th, 2006

WinRAR Free The greatest archiving utility in the whole world has done it again: WinRAR 3.51 won the 2006 “SIAF People’s Choice Award for Best Overall Utility“. The “Best Overall Utility” award was won by WinZip.

To express their hapiness towards this, as well as their thanks to all the people who voted for WinRAR, RarLab decided to have a 1-day offer of free registration keys for WinRAR 3.51.

All you have to do is fill in a simple form and you will receive your registration key by email. Registering will automatically place you in a mailinglist about the latest WinRAR releases and offers, but you can opt-out once you receive the first email. You may also choose to receive similar offers about software recommended by RarLab, if you are interested.

Keep in mind, though, that this is a non-upgradeable reg key, which only works with WinRAR 3.51, thus it will not be valid for the upcoming stable release of WinRAR 3.60 (currently Beta 8).

If all of the above is ok with you, hurry and get your key while the offer is still on. There are a lot of people interested in getting a free license (can’t say I’m amazed, WinRAR is an excellent utility), which kind of overloaded the win-rar.com website. You might need to try a few times to get in and submit the form correctly. Rest assured, though, that once you send the form, you will get the registration key.

*** RELEVANT LINKS ***

Get WinRAR 3.51 Registration Key
Download WinRAR 3.51
Read WinRAR Review

WinRAR 3.60 Beta 8 - Improved and Secure Compression

Thursday, July 20th, 2006

After a short absence, my postings WinRAR 3.60 Beta 7 Screenshotcontinue with another WinRAR Beta, this time version 3.60 Beta 7, which has been posted today on the Rarlab download site. Again, only the Windows GUI and command line versions have been updated. The DOS, Mac OS X, Linux, FreeBSD ports are still at Beta 6.

It seems that the developers of WinRAR are doing some kind of code auditing these days, since, like Beta 7, this release addresses a security issue - it fixes a stack overflow vulnerability in the SFX module.

See below for the full changelog information.

*** WHAT’S NEW IN WINRAR 3.60 BETA 8 ***

Stack overflow vulnerability has been corrected in SFX module.

*** RELEVANT LINKS ***

WinRAR Review
Download WinRAR 3.60 Beta 8 for Windows (.exe - 1MB)
Download RAR 3.60 Beta 6 for Mac OS X (.tar.gz - 357KB)
Download RAR 3.60 Beta 6 for Linux (.exe - 735KB)
Download RAR 3.60 Beta 6 for FreeBSD (.exe - 701KB)
Browse FTP Directory (other languages, themes, older releases)

Download WinRAR 3.60 Beta 7 and Get Compressing!

Thursday, July 13th, 2006

WinRAR 3.60 Beta 7 ScreenshotWinRAR 3.60 Beta 7 has been posted today on the Rarlab download site. Only the Windows GUI and command line versions have been updated. The DOS, Mac OS X, Linux, FreeBSD ports are still at Beta 6.

This release is basically a security patch - it fixes a stack overflow vulnerability in an archive processing component. The flaw was identified by a third party company.

See below for the full changelog information.

*** WHAT’S NEW IN WINRAR 3.60 BETA 7 ***

Stack overflow vulnerability has been corrected in WinRAR module processing LZH archives. We thank Ryan Smith, www.hustlelabs.com, for reporting this problem.

*** RELEVANT LINKS ***

WinRAR Review
Download WinRAR 3.60 Beta 7 for Windows (.exe - 1MB)
Download RAR 3.60 Beta 6 for Mac OS X (.tar.gz - 357KB)
Download RAR 3.60 Beta 6 for Linux (.exe - 735KB)
Download RAR 3.60 Beta 6 for FreeBSD (.exe - 701KB)
Browse FTP Directory (other languages, themes, older releases)

Quench your compression needs with WinRAR 3.60 Beta 6!

Monday, July 3rd, 2006

WinRAR 3.60 Beta 5 ScreenshotWinRAR 3.60 Beta 6 has been posted just minutes ago on the Rarlab download site. Beside the Windows GUI version, the command line DOS, Linux, Mac OS and FreeBSD have been updated.

The release brings forth a few bug fixes, generally related to command line switches (options).

See below for the full changelog information.

*** WHAT’S NEW IN WINRAR 3.60 BETA 6 ***

- Switch -ad did not work in GUI winrar.exe.
- When repairing several archives, console RAR did not handle ‘No’ choice of overwrite archive request properly. It aborted the operation instead of skipping the current archive.

*** RELEVANT LINKS ***

WinRAR Review
Download WinRAR 3.60 Beta 6 for Windows (.exe - 1MB)
Download RAR 3.60 Beta 6 for Mac OS X (.tar.gz - 357KB)
Download RAR 3.60 Beta 6 for Linux (.exe - 735KB)
Download RAR 3.60 Beta 6 for FreeBSD (.exe - 701KB)
Browse FTP Directory (other languages, themes, older releases)

Command line compression for Windows

Tuesday, June 20th, 2006

*** CONTENTS ***

Introduction
Unix-style CLI compression
WinRAR goes command-line
The opensource connection: 7-Zip
CLI tools exit codes
Short Dictionary


*** INTRODUCTION ***

Back in the day when archiving meant putting a bunch of files together into a single bigger chunk in order to make the transfer to tape faster, tar was a common tool. It still is, today, in the UNIX world, typically used in conjunction with two standard compression utilities: gzip and bzip2. The resulting compressed file is sometimes called a “tarball”, although there’s no actual “tar” involved, just zeros and ones.

In the Windows world, and this applies to all modern operating systems (Mac OS X, Linux with a desktop environment such as KDE or Gnome), compression tasks are generally accomplished from within a GUI based program. Such software has been covered in previous articles about WinRAR, 7-Zip and WinZip. However, if you feel left out or totally uncool for not being able to use command line tools for archiving your stuff, read on and learn how to use strange sounding programs such as tar, gzip and bzip2, without installing a UNIX derivate (Linux, various BSD flavors and so on). Renowned compression software will not be avoided; WinRAR and 7-Zip both have command line interfaces and you’ll get a crash course on those too.


*** Tarring, gzipping and bzipping stuff like an uber-geek ***

Tar is a kind of a grandfather, he’s been around for ages and it’s seen a lot. It’s a bit tired, but wise and can do the job if you know how to “talk” to it. Even if you can’t teach it new tricks, the ones it already knows, albeit somewhat old, make it very flexible and fit for many situations. When coupled with auxiliary programs, e.g. gzip/bzip2 for compression, it becomes even more powerful.

You’ve probably seen some funny looking files with double extensions, like NAME.tar.gz or NAME.tar.bz2 and thought “what’s up with *that* ?”. Get ready, we’re about to shed some light on the subject (sunglasses optional)…

Two extensions means two programs were involved in the creation of that program. Take .tar.gz for example, the original data was first “tarred” to NAME.tar and then “gzipped” to NAME.tar.gz. Tar’s job is to look at all the files and directories it has to process and concatenate their contents, along with other information such as path, permissions and so on, into a single file with a .tar extension. Then, the .tar file was sent (“piped” in geek language) to gzip for compression, to obtain the .tar.gz thing. The “tar” program is smart though, and enables you to do this in a single step with a command similar to “tar czf *.doc docs.tar.gz” (to compress all .doc files into a single docs.tar.gz archive). Know this though: sometimes the two extensions are condensed into shorter forms such as “.tgz” and “.tbz2”.

Now, let’s see how we can do this on Windows, assuming you are running on Windows 2000 or later (XP, 2003). First of all, we need to access the command prompt (hopefully, you’ve at least *heard* of it before plunging into this article). To do that, go to Start->Run, type “cmd”, press Enter, then stand back and be amazed: the Windows command line (no, not good for h4×0ring). Next, we need the actual programs to work with, but how? Tar, gzip and bzip2 are UNIX programs, right? How could they run on Windows? Well, here’s one of the situations where opensource pays. Having access to the source of a software package makes it possible for that program to be “ported” to other platforms (i.e. modify its source so that it compiles on other operating systems and/or compilers).

All three utilities I’ve been babbling about until now have Windows ports. Gzip for Windows can be obtained from its official homepage and the same applies to bzip2. There are two tar ports actually, one is the traditional (GNU) Tar and the other is for BsdTar. The latter is said to be faster and can compress/decompress files without the use of the external gzip/bzip2 executables (“binaries” in geek-talk).

Once you obtained and installed the programs, as described above, you can start archiving right away.

To make a single .tar file with all the .docs in the current dir, use the command: “tar –cv *.doc –f AllMyDocs.tar”. The two “flags” we used stand for “create archive (c)” and “be verbose (v)” which basically means “don’t be selfish, tell me what you’re adding to the archive”.

To also compress (with gzip) the resulting .tar archive, you would normally add the “z” flag like so: “tar –czv *.doc –f AllMyDocs.tar”. However, this does not work - it fails with the error “tar: Cannot fork: Function not implemented tar: Error is not recoverable: exiting now”. Apparently, the win32 port of GNU Tar is not complete; it cannot “fork” child processes, which in English means that it cannot start a new copy of itself. Fear not, even if there is no fork in GNU Tar/win32’s world, there is a spoon and here’s where BsdTar enters the stage; just use something like “bsdtar –cvzf allmydocs.tar.gz *.doc” and you’re all set.

The above also applies to bzip2 compression, the flag to be used is “j” and the command becomes “bsdtar –cvjf allmydocs.tar.bz2 *.doc”.

If you’re a real geekboy, you can still use GNU Tar to gzip/bzip2, just “pipe” to these programs the data stream tar yielded by “tar” instead of writing it to a file, for example: “tar –cv *.doc gzip > allmydocs.tar.gz”.

Take a peek into the tarballs

Due to the “fork” issue, listing the contents of the archives we previously obtained is easier with “bsdtar”, but can be obtained with “tar” as well, by using some “pipe magic”.

To list the docs in your allmydocs.tar.gz archive using bsdtar, type: “bsdtar –tf allmydocs.tar.gz”. The same command works with bzipped files too: “bsdtar –tf allmydocs.tar.bz2”.

Using tar is a bit more complicated, but it can’t be too hard for such a good student such as yourself (you must be one, if you’re still with me): “gzip –dc allmydocs.tar.gz tar –t” or “bzip2 –dc allmydocs.tar.bz2 tar –t”. If you’re bothered by the warnings gzip/bzip2 display when decompressing data to standard output, just add another flag (-q suppress noncritical error messages) and you’ll be fine: “gzip –dcq allmydocs.tar.gz tar –t” or “bzip2 –dcq allmydocs.tar.bz2 tar –t”.

Finding the handy “-q” flag was accomplished by invoking the gzip/bzip2 help with “gzip –h” and “bzip2 –h”. Try it and notice the various options these programs provide to the user.

I want my files back! How do I get them out?

The “tar” flag for extraction is “-x” (big surprise, I know). So, a command for extracting all your aforementioned docs would be “bsdtar –xzvf allmydocs.tar.gz”. Since “bsdtar” is such a smart-ass, you can omit the flag which tells it what compression program was used to make the file (“-z” or “-j”), that’s why the command “bsdtar –xvf allmydocs.tar.gz” works just as well.

Again, using GNU Tar is a bit trickier – it involves “piping”: “gzip –dc allmydocs.tar.gz tar –xv” or “bzip2 –dc allmydocs.tar.bz2 tar –xv”.

Both commands will extract the contents of the archive, including paths information (directories).

RAR command line command parameters options switchesOk, that’s just peachy, but what about more advanced stuff?

It’s time for RAR and 7-Zip to show us what they’ve “got”. Beside basic archive operations (create, extract, list contents), these two are capable of lots of advanced stuff, for example (some features may not be available in both programs): add recovery record, repair archive, convert archive to SFX, encrypt files, freshen archive (update modified files), send compressed file to email, set dictionary size for compression, set the number of execution threads (useful for multiprocessor, dual core or HyperThreading machines), set password and so on.


*** RAR. Win RAR ***

WinRAR’s superspy CLI (Command Line Interface) version is named, simply, rar (actually rar.exe, but we’re going to call it just “rar” from now on). Best way to use it easily is to add “C:\Program Files\WinRAR” to your PATH environment variable, like you learned when we talked about “tar” and its friends. Once you’ve done that, type the command “rar” and press Enter in order to see a rather lengthy list of options and switches (flags) - we’ll be reviewing here the most important ones.

Unlike tar & co., rar’s main commands (create archive, extract and so on) are not treated like switches (flags) but are used “as-is” – a single letter immediately after the command invocation (e.g. “rar a ..” to create a new archive).

Basic commands in RAR

a – Add files to archive
Used to create a new archive or add files to an existing one
Example: “rar a allmydocs.rar *.doc” creates a RAR archive that contains all the doc files in the current directory.

c – Add archive comment
Used to add a text comment to an existing archive
Example: “rar c allmydocs.rar” allows you to interactively enter some text, which will be added to the archive as a comment.
An interesting variant of this option is cw, which dumps the comment to a file of your choice. “rar cw allmydocs.rar doc-comments.txt” would read the comment inside your archive and write it to the txt file.

e – Extract files to current directory
Used to quickly extract files from within an existing archive. Optionally, it can get only certain files (specified on the command line)
Extract all files example: “rar e allmydocs.rar” would uncompress all the arhive contents in the current directory
Extract certain file example: “rar e allmydocs.rar must-read.doc” would get only the must-read.doc out of the archive and put it in the working directory.

f – Freshen files in archive
Update archive by refreshing files that were modified since they were added to the archive or last “freshened”.
Example: “rar f allmydocs.doc” would check all corresponding files against their copy inside the archive, and update the archive where differences are found.

l – List archive
Used to display a list of files and other details contained by the archive. There are 3 modes for this command, each with its distinct set of info columns.

Default mode (l)
Shows file name, real size (in bytes), packed size, compression ratio, date and time, attributes, the CRC (Cyclic Redundancy Check) hash, the compression method and version.
Example: “rar l allmydocs.rar”

Technical mode (lt)
Additionally displays the Host OS (operating system used to create the archive, whether or not the archive is solid, and if the format is “old” or not.
Example: “rar lt allmydocs.rar”

Bare mode (lb)
Displays only the file names
Example: “rar lb allmydocs.rar”

Slightly more advanced stuff

d – Delete files or folders from archive
Used to delete one or more files inside an existing archive
Example: “rar d allmydocs.rar mustdelete.doc” would delete a single doc file from the archive
Another example: “rar d allmydocs.rar old_docs” would delete the entire “old_docs” folder (that is, including the contents)

t – Test archive files
Used to test that an archive is not damaged. Works by performing a fake extraction of the archive contents (extracted data is not actually written to disk).
Example: “rar t allmydocs.rar”

x – Extract files with full path
Used to obtain some files out of an archive, or to uncompress an entire archive. The files are extracted with “full paths”, which means the directory structure is recreated to match the one at the time of compression.

Simple mode:
Extracts all files in a RAR arhive
Example: “rar x allmydocs.rar”

Advanced mode:
Lets you skip extraction of files you don’t need, either by typing their names on the command line or by providing a exclusion list file.
Example (1): “rar x –xuseless.doc allmydocs.rar” (skips useless.doc while uncompressing the archive)
Example (2): “rar x –x@ allmydocs.rar” (then type filenames you want to skip)
Example (3): “rar mailto:x%20-x@skip.txt allmydocs.rar” (all files specified in skip.txt will be skipped)

Even more advanced stuff (good to impress on the first date)

s – Convert to SFX / remove SFX module
The default form of this command adds a SFX module to the archive of your choice, transforming it into a self-extracting ”.exe” archive, perfect if you want to distribute the archive but suspect that some of the recipients do not have a compression program capable of handling RAR files. The default.sfx module is used or, optionally, one specified in the command line immediately after the s command.
Example: “rar s allmydocs.rar”.

The “evil twin” of this command is s-, which removes SFX modules.
It will not overwrite the self-extracting (.exe) archive, but will create a new one with the usual “.rar” extension.
Example: “rar s- allmydocs.exe” creates a new archive named “allmydocs.rar”

r – Repair archive
Attempts to repair a damaged archive using any available recovery records. If recovery records are not available, rar will only reconstruct the archive (i.e. the file list), in order to be able to recover undamaged files. If recovery records are in fact available, rar can be much more efficient and rebuild the entire archive.
The repaired archive is saved to rebuilt.original_name.rar (no recovery record) or fixed.original_name.rar (recovery record(s) found).
Example: “rar r allmydocs.rar”

The rc variant of this command is designed to work with multi-volume archives and can reconstruct missing volumes.
The rr variant can be used to add a recovery record to an existing archive; for example “rar rr allmydocs.rar”.
The rv variant does the same thing, but for multi-volume archives; the recovery records are external files with the “.rev” extension.

u – Update files in archive
Adds files that are not in the archive (using the initial file spec used when creating the archive) and freshens the ones that already are included (see the f command). If you created an archive with a command such as “rar a allmydocs.rar *.doc”, updating it will look for new .doc files and add them to allmydocs.rar, plus it will check what files inside the archive have been modified in the “real world” – the filesystem.
Example: “rar u allmydocs.rar”

7-Zip command line parameters options switches
*** Bored of RARing things up? Then try some zipping. 7-zipping, to be more precise ***

7-Zip’s CLI interface is called 7z.exe, but after you get to know each other (i.e. after you add 7-Zip’s directory to your PATH environment variable), you may simply call it “7z”. Try that now, to get the commands and switches list, as in the nearby picture.

Simple operations (prerequisites for achieving coolness state)

a – Add files to archive
Used to create a new archive or add files to an existing one. Can be combined with the “-r” switch which affects directory recursion.
Example (1): “7z a testarc.7z *.*” creates a new archive containing all files in the current directory. Subdirectories are ignored.
Example (2): “7z a –r testarc.7z *.*” creates a new archive containing all files in the current directory, including the subdirectories.
For both examples, if the archive already exists, 7-Zip will check if new files should be added and update it accordingly

e - Extract files from archive (without using directory names)
Used to quickly uncompress an archive’s contents into the current directory or the one specified with “-o”. Caution: it does not use the stored path information (all files will be extracted in the current/output directory). Can also be combined with the “-r” and “-x” switches.

Simple mode:
Extract all files and place them in the current directory
Example: “7z e testarc.7z”

Advanced mode:
Lets you change the destination directory or exclude some files
Example (1): “7z e –ooutput_dir testarc.7z” extracts the archive’s contents in the “output_dir” directory (can be a fully qualified path including a drive letter)
Example (2): “7z e –r –x!*.txt” extracts all files inside the archive, except .txt files

l - Lists contents of archive
Used to list the contents of an archive (filenames, sizes, dates, attributes).
Example: “7z l testarc.7z”

u – Update files in archive
Used to add new files or update files inside an archive to match the changes in the original files. Similar to RAR’s freshen (f) command. Can be combined with the “-r” switch.
Example (1): “7z u testarc.7z *.*” will update all files in the archive with respect with the files in the current directory. New files missing in the archive will be added.
Example (2): “7z u –r testarc.7z *.doc” will work only with .doc files in the current directory and any subdirectories

A bit more advanced stuff

t – Test archive
Used to test the integrity of an archive or check files inside an archive. Can be combined with the “-r” and “-x” switches
Example (1): “7z t testarchive.7z” will test the archive, including all the files inside it
Example (2): “7z t –r testarchive.7z *.txt” will test all .txt files inside the archive

d – Delete files from archive
Used to delete some files from an archive. Can be combined with the “-r” and “-x” switches for more power
Example (1): “7z d testarchive.7z *.doc” – deletes all .doc files from the archive
Example (2): “7z d –r –x!important*.doc” – deletes all .doc files from the archive, except documents which have the word “important” in their filename

x - Extract with full paths
Used to extract files from an archive, using the stored full paths, to the current directory or the directory specified with “-o”. Can also be combined with the “-r” and “-x” switches.

Simple mode:
Extracts all files and places them in the current directory
Example (1): “7z x testarc.7z”

Advanced mode:
Lets you change the output directory or skip some files
Example (1): “7z x –r –ouncompressed testarc.7z” – extracts all files to the “uncompressed” directory
Example (2): “7z x –r –x!*.doc” – extracts all files except .doc files

Create SFX archives with the “–sfx” switch
Example (1): “7z a –sfx testarc.7z *.*” – creates a SFX archive containing all files in the current directory
Example (2): “7z a –sfx7z.sfx testarc.7z” – creates a SFX archive which displays a confirmation/options dialog when executed

Well, that’s about it regarding the usage guides. There are some even more advanced commands, options and switches, but you can find them for yourself in the programs’ documentation, after you get the hang of it by trying the stuff presented in this article.

The remainder of the guide includes a short piece about CLI tools exit codes and a term dictionary. Good luck!

*** EXIT CODES ***

Most CLI utilities are kind enough to report if the operation asked of them was successful or not. They do this after their execution ends, by using the so-called “exit codes” (or “return codes”). These are numbers and have special meanings, sometimes different from program to program. The exit codes are usually invisible to the normal user, but they are important when the CLI utilities are invoked in shell scripts in order to determine whether the script performs normally, or it encountered errors.

Below is the list of return codes for WinRAR and 7-Zip, a useful resource for programmers and advanced users.

WinRAR (RAR)

0 - Successful operation.
1 - Warning. Non fatal error(s) occurred.
2 - A fatal error occurred.
3 - CRC error occurred when unpacking.
4 - Attempt to modify a locked archive.
5 - Write error.
6 - File open error.
7 - Wrong command line option.
8 - Not enough memory.
9 - File create error.
255 - User break.

7-Zip

0 - No error
1 - Warning (Non fatal error(s)). For example, some files were locked by other application during compressing. So they were not compressed.
2 - Fatal error
7 - Command line error
8 - Not enough memory for operation
255 - User stopped the process

*** DICTIONARY ***

* Tar - traditional file archiver, originally used with tape devices. Does not compress, it only concatenates files in to a single “blob”
* Gzip – open source compression program (GNU)
* Bzip2 – another open source compression program, provides better compression rates at the expense of longer compression times
* Tarball – a package obtained by archiving a group of files with ‘tar” and then passing the result to “gzip” or “bzip2”
* Pipe – the “” character, used to combine several programs in a single command line call
* Switch – a way of modifying a program’s/command’s default functionality, usually specified on the command line using one or two dash characters (e.g.: -h or –help)