Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  GAFFITTER (1)


gaffitter - Genetic Algorithm File Fitter




gaffitter -t target[unit] [options...] <files>

command | gaffitter - -t target[unit] [options...] [files]

the unit suffixes ’k’, ’m’, ’g’ or ’t’ can be used, where:

k = KB/KiB, m = MB/MiB, g = GB/GiB and t = TB/TiB [default = bytes]


Genetic Algorithm File Fitter, GAFFitter for short, is a tool based on a genetic algorithm (GA) that tries to fit a collection of items into as few as possible volumes of a specific size.

For example, the items might be files/directories and the volumes might be CDs or DVDs.

The task of arranging items in such manner that the number of required bins is minimized is called Bin Packing, a NP-hard combinatorial problem for which no deterministic polynomial-time algorithm is known. Using heuristics, such as GAs, it is usually possible to approximate -- and often reach -- the best solution for the problem within a reasonable time.

    General options:

-t <f>[unit], --target <f>[unit]
target size (mandatory), f>0.0
use powers of 1000 (not 1024) for target, min, max and output sizes
--bins <n>, --vols <n>
maximum number of bins (volumes) [default = "unlimited"]
-v, --verbose
--min <f>[unit], --min-size <f>[unit]
minimum file size [default = none]
--max <f>[unit], --max-size <f>[unit]
maximum file size [default = none]
-B <n>, --block-size <n>
the smallest amount of bytes a file can occupy [default = 1]
--ss, --show-size
print the size of each file
--sb, --show-bytes
also print the sizes in bytes
--hi, --hide-items
don’t print the selected items
--hs, --hide-summary
hide summary line containing sum, difference and number of selected items
-s, --sort-by-size
sort the output by size, not by name
-n, --no-case
use case-insensitive sorting
-r, --sort-reverse
sort the output in reverse order
-z, --null-data
assume NULL (\0) as the delimiter of input files via stdin (pipe)
-Z, --null
same as --dw ’\0’. See also the -0 and --hs options
-0, --null-bins
same as --bs ’\0’. See also the -Z and --hs options
--bs <char>, --bins-separator <char>
separate bins (vols) with "char" [default = newline]
--ew <char>, --enclose-with <char>
enclose file names with "char" [default = none]
--dw <char>, --delimit-with <char>
delimit file names (lines) with "char" [default = newline]
print GAFFitter version and exit
-h, --help
print this help and exit

    Direct Input options:

--di, --direct-input
switch to direct input mode, i.e., read directly "size identifier" pairs instead of file names
--di-b, --di-bytes
assume input sizes as bytes
--di-k, --di-kb
assume input sizes as kibi bytes (KiB); KB if --di-si
--di-m, --di-mb
assume input sizes as mebi bytes (MiB); MB if --di-si
--di-g, --di-gb
assume input sizes as gibi bytes (GiB); GB if --di-si
--di-t, --di-tb
assume input sizes as tebi bytes (TiB); TB if --di-si
use powers of 1000 (not 1024) for input sizes

    Genetic Algorithm options:

--ga-s <n>, --ga-seed <n>
GA initialization seed, n>=0 [default = 1]; 0 = random
--ga-rs, --ga-random-seed
use random GA seed (same as --ga-seed 0)
--ga-ng <n>, --ga-num-generations <n>
maximum number of generations, n>0 [default = auto]
--ga-ps <n>, --ga-pop-size <n>
number of individuals, n>tournament_size [default = auto]
--ga-cp <f>, --ga-cross-prob <f>
crossover probability, 0.0<=f<=1.0 [default = 0.95]
--ga-mp <f>, --ga-mutation-prob <f>
mutation probability, 0.0<=f<=1.0 [default = 0.10]
--ga-sp <n>, --ga-sel-pressure <n>
selection pressure (tournament size), 2<=n<pop_size [default = 2]
--ga-theo [n], --ga-theoretical [n]
stop if the theoretical minimum number of bins is reached. If n is given, it is assumed to be the theoretical minimum number of bins.
Other search methods
--ap, --approximate
local approximation using Best Fit search (non-optimal but very fast)
--sp, --split
just split the input when target size is reached (preserves original order while splitting)


This is free software. You may redistribute copies of it under the terms of the GNU General Public License <>. There is NO WARRANTY, to the extent permitted by law.


Written by Douglas Adriano Augusto (daaugusto).
Search for    or go to Top of page |  Section 1 |  Main Index

gaffitter 0.6.0 GAFFITTER (1) August 2008

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.