Command line compressing tools


7Zip and Gzip are two tools that don’t need to be installed to be used,  you just need to download and execute from command prompt. To some people having no GUI could be an disadvantage.

To download 7Zip use this link http://sourceforge.net/projects/sevenzip/files/7-Zip/9.20/7za920.zip/download
To read more about 7Zip options read here http://www.dotnetperls.com/7-zip-examples

To download Gzip use this link www.gzip.org/gzip124xN.zip
To read more about Gzip options read here http://www.gzip.org/

Gzip Samples

To see all options type gzip –help

H:\gzip-1.3.12-1\bin>gzip --help
Usage: gzip [OPTION]... [FILE]...
Compress or uncompress FILEs (by default, compress FILES in-place).
Mandatory arguments to long options are mandatory for short options too.
  -a, --ascii       ascii text; convert end-of-line using local conventions
  -c, --stdout      write on standard output, keep original files unchanged
  -d, --decompress  decompress
  -f, --force       force overwrite of output file and compress links
  -h, --help        give this help
  -k, --keep        keep (don't delete) input files
  -l, --list        list compressed file contents
  -L, --license     display software license
  -n, --no-name     do not save or restore the original name and time stamp
  -N, --name        save or restore the original name and time stamp
  -q, --quiet       suppress all warnings
  -r, --recursive   operate recursively on directories
  -S, --suffix=SUF  use suffix SUF on compressed files
  -t, --test        test compressed file integrity
  -v, --verbose     verbose mode
  -V, --version     display version number
  -1, --fast        compress faster
  -9, --best        compress better
    --rsyncable   Make rsync-friendly archive
With no FILE, or when FILE is -, read standard input.
Report bugs to <bug-gzip@gnu.org>.

To compress all files in a directory

H:\gzip-1.3.12-1\bin>gzip -9 h:\logsiis\W3SVC1\*

To decompress all files in directory

H:\gzip-1.3.12-1\bin>gzip -d h:\logsiis\W3SVC1\*


As you can see the compression is very high so you can save some space.

7Zip Examples

To see all options type 7za –help

H:\7za920>7za.exe --help
7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]
<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries

To compress all files ina a directory into a single file.

H:\7za920>7za.exe a -t7z "h:\logsiis.7z" "h:\logsiis\W3SVC1\*.log

Compression file


For more examples read this link http://www.dotnetperls.com/7-zip-examples

Hope that this information can be useful.

Advertisements

About rodvars
Been working in IT Services/Consulting for the past 15 years. My main areas of work are planning, development, managing and administration System infrastructures focusing on optimizing user processes, enforcing business security, performance enhancements, high availabilty and infrastucture scalability.

One Response to Command line compressing tools

  1. Robbin says:

    We stumbled over here from a different web page and thought I might as well check things out. I like what I see so i am just following you. Look forward to looking over your web page yet again.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: